Assembly body hole alignment detection method and system based on geometric reasoning
Through geometric inference-based methods, the hole feature recognition and alignment detection of the assembly is solved, and the problem of limited hole alignment detection function in the prior art is realized, and automated and efficient hole alignment detection is realized, which is suitable for various complex assembly.
Patent Information
- Application Number
- CN202410977508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The hole alignment detection function in the existing three-dimensional modeling software is limited, and the holes cut out through 'stretching' or 'rotation' and the holes introduced outside cannot be identified, and the holes that need to be detected in the assembly cannot be automatically judged, resulting in detection efficiency. Low and leak-prone areas.
Using a geometric inference-based method, the Brep data of the assembly is optimized by vertex and edges, and the concaveness of the holes is identified, and the alignment of the holes is judged by combining the hole units and feature sets, and automatic detection of all holes in the assembly is achieved. and alignment judgment.
It improves the versatility and efficiency of hole alignment detection, can identify various types of hole characteristics, and automatically completes the alignment detection of holes in the assembly without manual intervention, and is suitable for complex assembly models.
Smart Images

Figure CN119004694A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of manufacturability analysis, and more specifically, relates to an assembly hole alignment detection method and system based on geometric reasoning. Background Art
[0002] In mechanical design, especially in the structural design of assemblies, hole alignment is particularly important to ensure accurate fit between components. The precise location and alignment of holes can prevent abnormal problems such as stress concentration and uneven force in the actual assembly process, reduce the wear of components, and extend their service life.
[0003] Currently, the detection of hole alignment between assemblies in the industry is mainly based on manual detection. Although a few 3D modeling software (such as SolidWorks, etc.) have built-in hole alignment detection functions, this function has limited conditional proofreading and can only detect holes modeled by the software's built-in "hole feature" function. Other holes cut out by "stretching" and "rotation", as well as holes in parts imported from outside, cannot be identified and cannot be aligned.
[0004] In general, the current detection methods for assembly hole alignment have the following shortcomings:
[0005] (1) The existing hole alignment detection function in existing 3D modeling software is limited (it can only detect holes modeled by the software's own "hole feature" function, and cannot identify holes cut out by other "stretching" and "rotation", as well as holes in parts imported from outside, nor can it perform alignment detection), and has poor versatility.
[0006] (2) For the entire assembly, existing 3D modeling software cannot automatically determine which holes need to be inspected and aligned, nor can it complete the inspection of all holes at one time.
[0007] (3) The existing manual inspection method is cumbersome, inefficient, and prone to missing some areas that need to be inspected. Summary of the invention
[0008] In response to the above defects or improvement needs of the prior art, the present invention provides an assembly hole alignment detection method and system based on geometric reasoning, which aims to solve the technical problems that the existing hole alignment detection function in the existing 3D modeling software is limited and has poor versatility, as well as the technical problems that the existing 3D modeling software cannot automatically determine which holes need to be detected and aligned, and cannot complete the detection of all holes at one time, and the technical problems that the manual detection method is cumbersome, inefficient, and prone to missing some areas that need to be detected.
[0009] To achieve the above object, according to one aspect of the present invention, a method for detecting assembly hole alignment based on geometric reasoning is provided, comprising the following steps:
[0010] (1) Analyze the assembly to be inspected 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), the Brep data thereof is successively subjected to vertex optimization processing and edge optimization processing to obtain 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 conditions 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), a hole unit set corresponding to the sub-part is obtained 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), the hole feature set corresponding to the sub-part is obtained based on the hole unit set corresponding to the sub-part obtained in step (4).
[0015] (6) For each sub-part in the assembly obtained in step (1), the type and the ID of the inward machining surface of each hole feature are obtained according to the hole feature set corresponding to the sub-part obtained in step (5). in , Outbound processing surface ID out and the axial vector V;
[0016] (7) The type and inward machining surface ID of each hole feature corresponding to each sub-part in the assembly obtained in step (6) in , Outbound processing surface ID out And the axial vector V, obtain the assembly hole feature corresponding to the assembly.
[0017] (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.
[0018] Preferably, step (1) is specifically as follows: first, use 3D modeling design software to open the assembly to be tested, 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 duplicate data therein, then, read the topological connection relationship between the geometric data in each sub-part through the secondary development interface, and remove isolated vertices, edges or faces therein (i.e., having no connection relationship with other geometric data); then, combine the obtained geometric data and topological connection relationship of each sub-part to form the Brep data of the sub-part.
[0019] Preferably, the process of performing vertex optimization processing on the Brep data of the sub-part in step (2) is as follows: first, read all vertices in the Brep data of the sub-part, and calculate the distance between two vertices. If the distance between two vertices is less than 0.01 mm, 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 all edges connected to the original vertex in the Brep data to connect 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 vertex and curve equation in a sub-part into one edge;
[0021] The specific process of edge optimization of the Brep data of the sub-part in step (2) is 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) with 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 is: (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 so, it means that the two edges have the same direction vector and are connected. At this time, fit edges E1 and E2 into an edge E3, whose two vertices are V1 and V3, and the direction vector is equal to T2; then, modify the topological relationship of all faces connected to edges E1 and E2, and connect them to the new edge E3. The connection order of other edges remains unchanged, and edges E1 and E2 are removed from the Brep data. If they are not equal, it means that these two edges cannot be fitted, and the traversal continues to the next pair of edges; then, for each two arc edges with the same vertices, a similar method is used to determine whether they can be fitted into an arc edge (since the curve equation of the 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 surface point and the plane normal vector, 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 arc edges have the same center and radius, and the planes where the two are located coincide, it means that the two arc edges are fitted into a new arc edge). If possible, then after fitting, the topological relationship of all faces connected to the two arc edges is modified and connected to the new arc edge. The connection order of other edges on the surface remains unchanged, and then the two arc edges are removed from the Brep data. If not, it means that the two arc edges cannot be fitted, and the traversal continues to the next pair of arc edges.
[0022] Preferably, the concavity and convexity of the edge described in step (3) refers to a topological relationship between the edge and its two adjacent faces;
[0023] For any point P on each edge E in the Brep data, if the angle α between the two faces connected to the edge at the point P is greater than 180°, then the edge E is a convex edge; if the angle α between the two faces connected to the edge at the point P is less than 180°, then the edge is a concave edge; if the angle α between the two faces connected to the edge at the point P is equal to 180°, then the edge is a smooth edge;
[0024] Smooth edges are further divided into smooth concave edges and smooth convex edges. Smooth concave edges mean that the normals of the two faces on edge E are in the same direction, but the normals of the two faces are opposite near edge E; while smooth convex edges mean that the normals of the two faces on edge E are opposite, but the normals of the two faces are separated near edge E.
[0025] The process of obtaining the concavity and convexity of the edge according to the connection conditions of all adjacent faces of the edge in step (3) includes the following sub-steps:
[0026] (3-1) For edge E, obtain a point P on the edge E and two faces A and B connected by the edge E;
[0027] (3-2) Get the normal vector of surface A at point P And get the normal vector of surface B at point P
[0028] (3-3) Get the tangent vector at point P on edge E
[0029] (3-4) Get the normal vector obtained in step (3-2) and and determine whether it is not equal to 1. If so, proceed to step (3-5); otherwise, proceed to step (3-6);
[0030] (3-5) According to the normal vector and Calculate the convexity factor d of edge E and determine 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, the concavity factor d of edge E is calculated using the formula
[0032] (3-6) Obtain a point P1 within surface A to ensure that the length of the vector (P, P1) is less than 1 mm and is consistent with the vector perpendicular to the plane B, and obtain a point P2 in the plane B to ensure that the length of the vector (P, P2) is less than 1 mm and is consistent with the vector vertical;
[0033] (3-7) Get the normal vector at point P1 in surface A and the normal vector at point P2 in surface B
[0034] (3-8) According to the normal vector and Calculate the convexity factor k of edge E and determine whether k>0. If so, it means that edge E is a smooth convex edge, and then go to step (3-9); otherwise, it means that edge E is a smooth concave edge, and then go to step (3-9).
[0035] (3-9) The calculated convexity and concavity of edge E is updated into the Brep data, and the process ends.
[0036] Preferably, step (4) comprises the following sub-steps:
[0037] (4-1) Set the counter i = 1 and initialize the hole unit set of the sub-part {holeunit c} is empty;
[0038] (4-2) Determine whether there is i ≤ updated Brep data Brep c The total number of face sets in face_size is established. If so, read the updated Brep data Brep c The i-th face in the face set Face i , then go to step (4-3); otherwise the process ends;
[0039] (4-3) Determine the updated Brep data Brep c The i-th face in the face set Face i Is the type of the inner cylindrical surface or inner conical surface? If so, create a new concave connection face set {ConcaveFaces} and set Face i Add it to the concave connected face set {ConcaveFaces}, and then go to step (4-4), otherwise set i=i+1 and return to step (4-2);
[0040] (4-4) Set counter j = 1;
[0041] (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);
[0042] (4-6) Set counter k=1;
[0043] (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 ink , then go to step (4-8), otherwise set j=j+1 and return to step (4-5);
[0044] (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);
[0045] (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);
[0046] (4-10) Set the counter m = 1, and initialize the hole unit face group set {holeunit} to empty;
[0047] (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);
[0048] (4-12) Set 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, get the nth face group faces in the hole unit face group set {holeunit} n , then go to step (4-14); otherwise, create a new face group face m , the face group face m Add to face group face n and add the face group face m After 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}. 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 type. 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 type, 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 be combined to 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 generatrix is 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 holds. 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 transfer to step (5-3); otherwise, transfer 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 , 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};
[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 transfer 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 the jth hole feature hole j The axial vector of the kth hole feature hole k Are the axial vectors of coaxial? If yes, proceed to step (5-9); otherwise, set k=k+1 and return to step (5-7);
[0071] (5-9) Determine the jth hole feature hole j The convex edge set {edgeunit j} and the kth hole feature hole k The convex edge set {edgeunit k}, if not, set k = k + 1 and return to step (5-7); if so, set the same convex edge unit edge unit same From the convex edge group set {edgeunit j} and the convex edge set {edgeunit k} and set the convex edge group set {edgeunit k} to add the elements in the convex edge group set {edgeunit j}, then go to step (5-10);
[0072] (5-10) The kth hole feature hole k holeunit k Add to hole feature jth hole j In the convex edge group set {edgeunit j}Updated to the jth hole feature hole j The convex edge set {edgeunit j}, and delete the kth hole feature hole from the hole feature set {hole} k , then return to step (5-7);
[0073] Preferably, step (6) comprises the following sub-steps:
[0074] (6-1) Set counter u = 1;
[0075] (6-2) Determine whether u ≤ the total number of elements in the hole feature set {hole}, holesize. If so, get the uth hole feature hole in the hole feature set {hole} u , and go to step (6-3); otherwise the process ends;
[0076] (6-3) Get the u-th hole feature hook u The corresponding number of hole units (such as Figure 7 As shown in u , 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 of the u-th hole feature hoke u , and then go to step (6-4); u
[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 from the set of hole units {unit u}. The axial vector of this hole unit holeunit begin is the axial vector of the u-th hole feature hoke begin . Then go to step (6-4); u
[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 . 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 it is 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) Obtain the number of machined faces machinedfacesize in the set of machined faces {machinedface u}, and determine whether 0 < machinedfacesize ≤ 2 exists. If it exists, proceed to step (6 - 11); otherwise, u = u + 1 and return to step (6 - 2);
[0085] (6 - 11) Determine whether the number of machined faces machinedfacesize in the set of machined faces {machinedface u} corresponding to the hole feature hole u is equal to 1. If so, set the in - facing machined face ID u of the u - th hole feature hole in to the first face in the set of machined faces {machinedface u}, set u = u + 1, and return to step (6 - 2); otherwise, proceed to step (6 - 12);
[0086] (6 - 12) Obtain the first face machinedface u and the second face machinedface first in the set of machined faces {machinedface second}, obtain the first hole unit unit u and the second hole unit unit u in 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 in - facing machined face ID u of the hole feature hole in to machinedface first , set the out - facing machined face ID u of the hole feature hole u to machinedface second , and then proceed to step (6 - 13); otherwise, set the in - facing machined face ID u of the hole feature hole in to machinedface second , set the out - facing machined face ID u of the hole feature hole in to machinedface first , as shown in Figure 8 ;
[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, 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 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);
[0096] (7-8) Determine whether the outgoing machining surface ID cnt1 of the hole feature hole out ...cnt2 ID of the entry machining surface in Are they parallel and the distance between them is smaller than the hole feature hole cnt2 If yes, go to step (7-11), otherwise go to step (7-9);
[0097] (7-9) Determine the cnt2th hole feature corresponding to the dth sub-part in the assembly cnt2 Is there an outgoing machining surface ID? out , if it does not exist, set cnt2=cnt2+1 and return to step (7-6), otherwise go to step (7-10);
[0098] (7-10) Determine hole characteristics cnt2 ID of the outgoing machining surface out With hole feature hole cnt1 ID of the entry machining surface in Are they parallel and the distance between them is less than the hole? cnt1 If not, set cnt2=cnt2+1 and return to step (7-6); otherwise, go to step (7-11);
[0099] (7-11) The two hole features {hole cnt1 ,hole cnt2}Add to the assembly hole feature set {assemblyholes}, set cnt2=cnt2+1, and return to step (7-6).
[0100] Preferably, step (8) comprises the following sub-steps:
[0101] (8-1) Set counter o=1;
[0102] (8-2) Determine whether there is o ≤ the number of assembly hole features in the assembly hole feature set assemblyholes_size. If so, read the oth assembly hole feature assemblyholes o ; Otherwise the process ends;
[0103] (8-3) Extract the oth assembly hole feature in the assembly hole feature set assemblyholes o The two hole features in the figure are obtained, and the axial vectors Vec1 and Vec2 of the two hole features are obtained respectively;
[0104] (8-4) Calculate the distance dis between Vec1 and Vec2, and determine whether the distance dis≤0.001mm. If so, it means that the two axial vectors are coaxial, that is, the oth assembly hole feature assemblyholes oThe two holes are aligned; otherwise, it indicates that the oth assembly hole feature assemblyholes o The two holes in the are not aligned and need to be adjusted. Fig. 9 As shown, then go 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, comprising:
[0107] The first module is used to analyze the assembly to be inspected to obtain the boundary representation Brep data of each sub-part in the assembly;
[0108] The second module is used for successively performing vertex optimization processing and edge optimization processing on the Brep data of each sub-part in the assembly obtained by the first module, so as to obtain the optimized Brep data corresponding to the sub-part;
[0109] The third module is used for obtaining, for each sub-part in the assembly obtained by the first module, each edge in the optimized Brep data corresponding to the sub-part obtained by the second module, obtaining the concavity and convexity of the edge according to the connection conditions of all adjacent faces of the edge, and filling 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 for obtaining, for each sub-part in the assembly obtained by the first module, a 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 obtain, for each sub-part in the assembly obtained by the first module, a hole feature set corresponding to the sub-part based on a hole unit set corresponding to the sub-part obtained by the fourth module.
[0112] The sixth module is used to obtain the type and the ID of the inward machining surface of each hole feature in each sub-part in the assembly obtained by the first module according to the hole feature set corresponding to the sub-part obtained by the fifth module. in , Outbound processing surface ID out and the axial vector V;
[0113] The seventh module is used to obtain the type and the ID of the machining surface of each hole feature corresponding to each sub-part in the assembly according to the sixth module. in , Outbound processing surface ID out And the axial vector V, obtain the assembly hole feature corresponding to the assembly.
[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] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0116] (1) The detection of hole alignment in an assembly is universal: Since the present invention adopts steps (1) to (5), it can identify the characteristics of holes from the geometric data such as points, lines, and surfaces of the three-dimensional model of the assembly in combination with properties such as convexity and concavity. It can not only identify the holes inserted by the three-dimensional design software through its own functions, but also accurately identify the holes formed by modeling by stretching, rotation, etc.
[0117] (2) Rapidly analyzing the positional relationship between holes between different parts in the entire assembly to find all possible assembly hole combinations: The present invention provides a technology for automatically identifying assembly holes in a three-dimensional model of an assembly through the algorithms of steps (7) and (8). This technology not only has high recognition efficiency, but is also applicable to various complex assembly models.
[0118] (3) Automatically detect whether assembly holes are aligned without manual intervention: The present invention combines hole feature recognition technology with assembly hole alignment detection technology to provide a fully automatic method that does not require manual intervention to quickly and efficiently detect the alignment of holes in an assembly, giving full play to the capabilities of computer-aided design, allowing designers to quickly determine whether the three-dimensional model is reasonably designed during the model design process. BRIEF DESCRIPTION OF THE DRAWINGS
[0119] Figure 1 It is an overall flow chart of the assembly hole alignment detection method based on geometric reasoning of the present invention;
[0120] Figure 2 It is a boundary representation hierarchical relationship diagram;
[0121] Figure 3 It is a schematic diagram of the concavity and convexity of the calculated edge in the Brep data of the part;
[0122] Figure 4 It is a flowchart of hole unit identification;
[0123] Figure 5 It is a flow chart of hole feature recognition;
[0124] Figure 6 is a schematic diagram of different hole units;
[0125] Figure 7is a schematic diagram of different hole characteristics;
[0126] Figure 8 It is a schematic diagram of the axial direction, convex edge group, machined surface, etc. of the hole feature;
[0127] Fig. 9 This is a schematic diagram to show whether the assembly holes are aligned. DETAILED DESCRIPTION
[0128] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with 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 intended 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 an assembly hole alignment detection method based on geometric reasoning, which analyzes the geometric structure and topological relationship of the assembly three-dimensional model, firstly identifies the hole units in each sub-part in a certain way, then combines the hole units to form hole features according to the association relationship between the hole units, and then determines which ones are assembly holes according to the positional relationship of the hole features between different parts, and finally determines whether the axial vectors of the two holes in the assembly hole combination are coaxial, and coaxiality means that the holes are aligned.
[0130] like Figure 1 As shown, the present invention provides an assembly hole alignment detection method based on geometric reasoning, comprising the following steps:
[0131] (1) Analyze the assembly to be inspected to obtain the boundary representation (Brep) data of each sub-part in the assembly;
[0132] Step (1) is specifically as follows: first, use 3D modeling design software (such as CREO, UG, etc.) to open the assembly to be tested; 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; then, read the topological connection relationship between the geometric data in each sub-part through the secondary development interface, and remove the isolated vertices, edges or faces (i.e., no connection relationship with other geometric data); then, combine the obtained geometric data and topological connection relationship of each sub-part to form the Brep data of the sub-part, such as Figure 2 shown.
[0133] (2) for each sub-part in the assembly obtained in step (1), the Brep data thereof is successively subjected to vertex optimization processing and edge optimization processing to obtain optimized Brep data corresponding to the sub-part;
[0134] In this step, the vertex optimization process of the Brep data of the sub-part is as follows: first, read all the vertices in the Brep data of the sub-part and calculate the distance between the two vertices. If the distance between the two vertices is less than 0.01mm, 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 all the edges connected to the original vertex in the Brep data to connect 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 in a sub-part that have the same vertices and curve equations into one edge.
[0136] The specific process of edge optimization of Brep data of sub-parts in this step is as follows: first, read all edges in Brep data of sub-parts; then, for every two edges E1 (whose two vertices are V1 and V2, and they are straight edges) and E2 (whose two vertices are V2 and V3, and they are straight edges) with 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 E1: (x, y, z) = b*T1+(x1, y1, z1), where T1 is the straight line direction vector and b is an arbitrary real number; The curve equation of 2 is: (x, y, z) = d*T2 + (x2, y2, z2), where T2 is the direction vector of the line and d is an arbitrary real number; then, determine whether T1 is equal to T2. If so, it means that the two edges have the same direction vector and are connected. At this time, fit the edges E1 and E2 into an edge E3, whose two vertices are V1 and V3, and the direction vector is equal to T2; then, modify the topological relationship of all faces connected to the edges E1 and E2, connect them to the new edge E3, and the other faces on the faces are connected to the new edge E3. The connection order of the edges remains unchanged, and the edges E1 and E2 are removed from the Brep data. If they are not equal, it means that the two edges cannot be fitted, and the traversal continues to the next pair of edges; then, for each two arc edges with the same vertices, a similar method is used to determine whether they can be fitted into an arc edge (since the curve equation of the 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 surface point and the plane normal vector, 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 the two arc edges have the same center and radius, and the planes where the two are located coincide, it means that the two arc edges are fitted into a new arc edge). If possible, then after fitting, the topological relationship of all faces connected to the two arc edges is modified and connected to the new arc edge. The connection order of other edges on the surface remains unchanged, and then the two arc edges are removed from the Brep data. If not, it means that the two arc edges cannot be fitted, and the traversal continues to the next pair of 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 the sub-part obtained in step (2), obtain the concavity and convexity of the edge according to the connection conditions 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;
[0138] The concavity of the edge described in step (3) refers to a topological relationship between the edge and its two adjacent faces;
[0139] For any point P on each edge E in the Brep data, if the angle α between the two faces connected to the edge at the point P is greater than 180°, then the edge E is a convex edge; if the angle α between the two faces connected to the edge at the point P is less than 180°, then the edge is a concave edge; if the angle α between the two faces connected to the edge at the point P is equal to 180°, then the edge is a smooth edge;
[0140] Smooth edges are further divided into smooth concave edges and smooth convex edges. Smooth concave edges indicate that the normals of the two faces on edge E are in the same direction, but the normals of the two faces are opposite near edge E; while smooth convex edges are opposite, indicating that the normals of the two faces on edge E are opposite, but the normals of the two faces near edge E are separated.
[0141] like Figure 3 As shown, the process of obtaining the concavity and convexity of the edge according to the connection conditions of all adjacent faces of the edge in step (3) includes the following sub-steps:
[0142] (3-1) For edge E, obtain a point P on the edge E and two faces A and B connected by the edge E;
[0143] (3-2) Get the normal vector of surface A at point P And get the normal vector of surface B at point P
[0144] (3-3) Get the tangent vector at point P on edge E
[0145] (3-4) Get the normal vector obtained in step (3-2) and and determine whether it is not equal to 1. If so, proceed to step (3-5); otherwise, proceed to step (3-6);
[0146] (3-5) According to the normal vector and Calculate the convexity factor d of edge E and determine 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).
[0147] Specifically, the concavity factor d of edge E is calculated using the formula
[0148] (3-6) Obtain a point P1 within surface A to ensure that the length of the vector (P, P1) is less than 1 mm and is consistent with the vector perpendicular to the plane B, and obtain a point P2 in the plane B to ensure that the length of the vector (P, P2) is less than 1 mm and is consistent with the vector vertical;
[0149] (3-7) Get the normal vector at point P1 in surface A and the normal vector at point P2 in surface B
[0150] (3-8) According to the normal vector and Calculate the convexity factor k of edge E and determine whether k>0. If so, it means that edge E is a smooth convex edge, and then go to step (3-9); otherwise, it means that edge E is a smooth concave edge, and then go to step (3-9).
[0151] Specifically, the concavity factor k of edge E is calculated using the formula
[0152] (3-9) The calculated convexity and concavity of edge E is updated into the Brep data, and the process ends.
[0153] (4) For each sub-part in the assembly obtained in step (1), a hole unit set corresponding to the sub-part is obtained according to the updated Brep data corresponding to the sub-part obtained in step (3);
[0154] like Figure 4 As shown, step (4) includes the following sub-steps:
[0155] (4-1) Set the counter i = 1 and initialize the hole unit set of the sub-part {holeunit c} is empty;
[0156] (4-2) Determine whether there is i ≤ updated Brep data Brep c The total number of face sets in face_size is established. If so, read the updated Brep data Brep c The i-th face in the face set Face i , then go to step (4-3); otherwise the process ends;
[0157] (4-3) Determine the updated Brep data Brep c The i-th face in the face set Face i Is the type of the inner cylindrical surface or inner conical surface? If so, create a new concave connection face set {ConcaveFaces} and set Face i Add it to the concave connected face set {ConcaveFaces}, and then go to step (4-4), otherwise set i=i+1 and return to step (4-2);
[0158] (4-4) Set 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 counter n = 1;
[0167] (4-13) Determine whether n ≤ the total number of elements size_n in the hole unit face group set {holeunit} holds. If so, get the nth face group faces in the hole unit face group set {holeunit} n , then go to step (4-14); otherwise, create a new face group faces m , the face group face m Add to face group faces n and add the face group face m After the face group faces n Add to the hole unit face group set {holeunit} and return to step (4-11);
[0168] (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);
[0169] (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);
[0170] (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);
[0171] (4-17) Determine the first face beginWith 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);
[0172] (4-18) Set counter p = 1, cylsize = 0, planesize = 0, othersize = 0;
[0173] (4-19) Determine whether p ≤ the total number of elements size_n in the hole unit face group set {holeunit} holds. If so, get the pth face group faces in the hole unit face group set {holeunit} p ; Otherwise, go to step (4-24)
[0174] (4-20) Determine the pth face group faces in the hole unit face group set {holeunit} p The type of the first face in is cylindrical or conical, plane, or other types. If it is a cylindrical or 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);
[0175] (4-21) Determine the pth face group in the hole unit face group set {holeunit} p After all the faces in are merged, can they form a complete cylindrical surface or conical surface? 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) Get the pth face group face in the hole unit face group set {holeunit} p The convex edge group {edgeunit} in the figure is a group of arc edges (edges where the non-cylindrical generatrix is located) connected end to end. Each arc edge is a convex edge. All arc edges form a complete circle as a whole. Get the face where the complete circle is located. r ;
[0177] (4-23) Determine the convex edge unit relative to the 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 Figure 6 shown, and add the hole unit hole_unit to the hole unit set {holeunit c}, set i = i + 1, and 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 Figure 5 shown, 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 c from the hole unit set {holeunit t}, and then go to step (5-3). Otherwise, go to step (5-5);
[0184] (5-3) Create the 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 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 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}, add the elements of the set of convex edge groups {edgeunit j} to the set of convex edge groups {edgeunit
[0191] (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 set of convex edge groups {edgeunit j} to the j-th hole feature hole jThe convex edge set {edgeunit j}, and delete the kth hole feature hole from the hole feature set {hole} k , then return to step (5-7);
[0192] The advantages of the above steps (1) to (5) are that the feature recognition of holes is performed based on the geometric data of points, lines, surfaces, etc. of the three-dimensional model in combination with properties such as convexity and concavity. Not only can the holes inserted in the three-dimensional design software through its own functions be recognized, but also the holes formed by modeling through stretching, rotation, etc. can be accurately recognized. This method is universal and can accurately recognize hole features of various types and constructed in various ways.
[0193] (6) For each sub-part in the assembly obtained in step (1), the type and the ID of the inward machining surface of each hole feature are obtained according to the hole feature set corresponding to the sub-part obtained in step (5). in , Outbound processing surface ID out and the axial vector V;
[0194] Specifically, step (6) includes the following sub-steps:
[0195] (6-1) Set counter u = 1;
[0196] (6-2) Determine whether u ≤ the total number of elements in the hole feature set {hole}, holesize. If so, get the uth hole feature hole in the hole feature set {hole} u , and go to step (6-3); otherwise the process ends;
[0197] (6-3) Get the u-th hole feature hole u The corresponding number of hole units (such as Figure 7 As shown), if there is only one hole unit, it means that the u-th hole feature hole u For a simple hole, the simple hole is divided into a simple cylindrical hole or a simple conical hole according to the type of the side surface in the hole unit (cylindrical surface or conical surface); if there are two hole units, the hole feature is divided into a countersunk hole and a countersunk hole according to the type of the hole unit with a larger hole diameter (cylindrical surface unit or conical surface unit); if there are more than two hole units, it means that the hole feature is a composite hole, and the axial vector of the first hole unit inside is taken as the uth hole feature hole u The axial vector holevec u , then go to step (6-4);
[0198] (6-3) Get the u-th hole feature hole u The corresponding hole unit set {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, 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 it does, 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 set of convex edge groups {edgeunit u}, set the counter w = 1, and initialize the set of machined faces {machinedface u} of the hole feature hole u as empty;
[0203] (6 - 8) Determine whether w ≤ the number edgeunitsize of convex edge groups in the set of convex edge groups {edgeunit u} holds. If so, obtain the w-th convex edge group edgeunit u in the set of convex edge groups {edgeunit u}, and then go to step (6 - 9); otherwise, go to step (6 - 10);
[0204] (6 - 9) Obtain the first edge edge u in the w-th convex edge group edgeunit w in the set of convex edge groups {edgeunit begin}, obtain the two adjacent faces face c and face y to this edge from the updated Brep data brep z , and determine 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 go to 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);
[0205] (6 - 10) Obtain the number machinedfacesize of machined faces in the set of machined faces {machinedface u}, determine whether 0 < machinedfacesize ≤ 2 exists. If it exists, go to step (6 - 11); otherwise, u = u + 1, and return to step (6 - 2);
[0206] (6 - 11) Determine whether the number machinedfacesize of machined faces in the set of machined faces {machinedface u} corresponding to the hole feature hole u is equal to 1. If so, set the ID of the in - going machined face of the u-th hole feature hole u 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);
[0207] (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;
[0208] (6-13) Set u=u+1 and return to step (6-2);
[0209] (7) The type and inward machining surface ID of each hole feature corresponding to each sub-part in the assembly obtained in step (6) in , Outbound processing surface ID out And the axial vector V, obtain the assembly hole feature corresponding to the assembly.
[0210] Step (7) determines which hole combinations can constitute assembly hole features based on the relative positional relationship between different hole features.
[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 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;
[0214] (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);
[0215] (7-4) Set counters cnt1 = 1, cnt2 = 1;
[0216] (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);
[0217] (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);
[0218] (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);
[0219] (7-8) Determine whether 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 yes, go to step (7-11), otherwise go to step (7-9);
[0220] (7-9) Determine the cnt2th hole feature corresponding to the dth sub-part in the assembly cnt2 Is there an outgoing machining surface ID? out , if it does not exist, set cnt2=cnt2+1 and return to step (7-6), otherwise go to step (7-10);
[0221] (7-10) Determine hole characteristics cnt2 ID of the outgoing machining surface out With hole feature hole cnt1 ID of the entry machining surface in Are they parallel and the distance between them is less than the hole? cnt1 If not, set cnt2=cnt2+1 and return to step (7-6); otherwise, go to step (7-11);
[0222] (7-11) The two hole features {hole cnt1 ,hole cnt2}Add 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 that the two holes in the assembly hole feature are aligned. Otherwise, it means that the two holes are not aligned.
[0224] Step (8) includes the following sub-steps:
[0225] (8-1) Set counter o=1;
[0226] (8-2) Determine whether there is o ≤ the number of assembly hole features in the assembly hole feature set assemblyholes_size. If so, read the oth assembly hole feature assemblyholes o ; Otherwise the process ends;
[0227] (8-3) Extract the oth assembly hole feature in the assembly hole feature set assemblyholes o The two hole features in the figure are obtained, and the axial vectors Vec1 and Vec2 of the two hole features are obtained respectively;
[0228] (8-4) Calculate the distance dis between Vec1 and Vec2, and determine whether the distance dis≤0.001mm. If so, it means that the two axial vectors are coaxial, that is, the oth assembly hole feature assemblyholes o The two holes are aligned; otherwise, it indicates that the oth assembly hole feature assemblyholes o The two holes in the are not aligned and need to be adjusted. Fig. 9 As shown, then go to step (8-5);
[0229] (8-5) o=o+1, return to step (8-2);
[0230] The advantage of the above steps (7) and (8) is that, through the positional relationship between the hole features, all assembly hole features in the entire assembly are automatically analyzed and acquired, and then it is automatically determined whether the two holes in the assembly hole features are aligned. This technology not only has high recognition efficiency, but is also applicable to various complex assembly models.
[0231] The present invention provides an assembly hole alignment detection method based on geometric reasoning, which first identifies all holes inside the assembly by means of geometric reasoning, and then detects the hole groups that are close in distance and need to be aligned according to the relative position relationship between the identified holes, so as to quickly obtain the alignment 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 versatility and supports various styles of holes. Whether the holes are formed by modeling operations such as stretching or rotation, they can be normally identified and detected.
[0232] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting assembly hole alignment based on geometric reasoning, characterized in that: The following steps are involved: (1) Analyze the assembly to be inspected 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), the Brep data thereof is successively subjected to vertex optimization processing and edge optimization processing to obtain 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 conditions 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), a hole unit set corresponding to the sub-part is obtained 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), the hole feature set corresponding to the sub-part is obtained based on the hole unit set corresponding to the sub-part obtained in step (4). (6) For each sub-part in the assembly obtained in step (1), the type and the ID of the inward machining surface of each hole feature are obtained according to the hole feature set corresponding to the sub-part obtained in step (5). in , Outbound processing surface ID out and the axial vector V; (7) The type and inward machining surface ID of each hole feature corresponding to each sub-part in the assembly obtained in step (6) in , Outbound processing surface ID out And the axial vector V, obtain the assembly hole feature corresponding to the assembly. (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 assembly hole alignment detection method based on geometric reasoning according to claim 1 is characterized in that: Step (1) is specifically as follows: first, use 3D modeling design software to open the assembly to be tested; 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 duplicate data; then, read the topological connection relationship between the geometric data in each sub-part through the secondary development interface, and remove isolated vertices, edges or faces (i.e., no connection relationship with other geometric data); then, combine the obtained geometric data and topological connection relationship of each sub-part to form the Brep data of the sub-part.
3. The assembly hole alignment detection method based on geometric reasoning according to claim 1 or 2, characterized in that: The specific process of performing vertex optimization processing on the Brep data of the sub-part in step (2) is as follows: first, read all vertices in the Brep data of the sub-part, and calculate the distance between two vertices. If the distance between two vertices is less than 0.01mm, 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 all edges connected to the original vertex in the Brep data to connect 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 vertex and curve equation in a sub-part into one edge; The specific process of edge optimization of the Brep data of the sub-part in step (2) is 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) with 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 is: (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 so, it means that the two edges have the same direction vector and are connected. At this time, fit edges E1 and E2 into an edge E3, whose two vertices are V1 and V3, and the direction vector is equal to T2; then, modify the topological relationship of all faces connected to edges E1 and E2, and connect them to the new edge E3. The connection order of other edges remains unchanged, and edges E1 and E2 are removed from the Brep data. If they are not equal, it means that these two edges cannot be fitted, and the traversal continues to the next pair of edges; then, for each two arc edges with the same vertices, a similar method is used to determine whether they can be fitted into an arc edge (since the curve equation of the 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 surface point and the plane normal vector, 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 arc edges have the same center and radius, and the planes where the two are located coincide, it means that the two arc edges are fitted into a new arc edge). If possible, then after fitting, the topological relationship of all faces connected to the two arc edges is modified and connected to the new arc edge. The connection order of other edges on the surface remains unchanged, and then the two arc edges are removed from the Brep data. If not, it means that the two arc edges cannot be fitted, and the traversal continues to the next pair of arc edges.
4. The assembly hole alignment detection method based on geometric reasoning according to any one of claims 1 to 3, characterized in that: The concavity of the edge described in step (3) refers to a topological relationship between the edge and its two adjacent faces; For any point P on each edge E in the Brep data, if the angle α between the two faces connected to the edge at the point P is greater than 180°, then the edge E is a convex edge; if the angle α between the two faces connected to the edge at the point P is less than 180°, then the edge is a concave edge; if the angle α between the two faces connected to the edge at the 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. Smooth concave edges mean that the normals of the two faces on edge E are in the same direction, but the normals of the two faces are opposite near edge E; while smooth convex edges mean that the normals of the two faces on edge E are opposite, but the normals of the two faces are separated near edge E. The process of obtaining the concavity and convexity of an edge based on the connection conditions of all adjacent faces of the edge in step (3) includes the following sub-steps: (3-1) For edge E, obtain a point P on the edge E, and two faces A and B connected by the edge E; (3-2) Get the normal vector of surface A at point P And get the normal vector of surface B at point P (3-3) Get the tangent vector at point P on edge E (3-4) Get the normal vector obtained in step (3-2) and and determine whether it is not equal to 1. If so, proceed to step (3-5); otherwise, proceed to step (3-6); (3-5) According to the normal vector and Calculate the convexity factor d of edge E and determine 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). Specifically, the concavity factor d of edge E is calculated using the formula (3-6) Obtain a point P1 within surface A to ensure that the length of the vector (P, P1) is less than 1 mm and is consistent with the vector perpendicular to the plane B, and obtain a point P2 in the plane B to ensure that the length of the vector (P, P2) is less than 1 mm and is consistent with the vector vertical; (3-7) Get the normal vector at point P1 in surface A and the normal vector at point P2 in surface B (3-8) According to the normal vector and Calculate the convexity factor k of edge E and determine whether k>
0. If so, it means that edge E is a smooth convex edge, and then go to step (3-9); otherwise, it means that edge E is a smooth concave edge, and then go to step (3-9). (3-9) Update the concavity and convexity of edge E obtained by calculation to the Brep data, and the process ends.
5. The assembly hole alignment detection method 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 hole unit set of the sub-part {holeunit c } is empty; (4-2) Determine whether there is i ≤ updated Brep data Brep c The total number of face sets in face_size is established. If so, read the updated Brep data Brep c The i-th face in the face set Face i , then go to step (4-3); otherwise the process ends; (4-3) Determine the updated Brep data Brep c The i-th face in the face set Face i Is the type of the inner cylindrical surface or inner conical surface? If so, create a new concave connection face set {ConcaveFaces} and set Face i Add it to the concave connected face set {ConcaveFaces}, and then go to step (4-4), otherwise set i=i+1 and return to step (4-2); (4-4) Set counter j = 1; (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); (4-6) Set counter k = 1; (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); (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); (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); (4-10) Set counter m = 1, and initialize the set of hole unit face groups {holeunit} to be empty; (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); (4-12) Set counter n = 1; (4-13) Determine whether n ≤ the total number of elements size_n in the hole unit face group set {holeunit} holds. If so, get the nth face group faces in the hole unit face group set {holeunit} n , then go to step (4-14); otherwise, create a new face group faces m , the face group face m Add to face group faces n and add the face group face m After the face group faces n Add to the hole unit face group set {holeunit} and return to step (4-11); (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); (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); (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); (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); (4-18) Set counter p = 1, cylsize = 0, planesize = 0, othersize = 0; (4-19) Determine whether p ≤ the total number of elements size_n in the hole unit face group set {holeunit} holds. If so, get the pth face group faces in the hole unit face group set {holeunit} p ; Otherwise, go to step (4-24) (4-20) Determine the pth face group faces in the hole unit face group set {holeunit} p The type of the first face is cylindrical or conical, plane, or other types. If it is a cylindrical or 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 of other types, then set othersize = othersize + 1, p = p + 1, and return to step (4-19); (4-21) Determine the pth face group in the hole unit face group set {holeunit} p After all the faces in are merged, can they form a complete cylindrical surface or conical surface? 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) Get the pth face group faces in the hole unit face group set {holeunit} p The convex edge group {edgeunit} in the figure is a group of arc edges (edges where the non-cylindrical generatrix is located) connected end to end. Each arc edge is a convex edge. All arc edges form a complete circle as a whole. Get the face where the complete circle is located. r ; (4-23) Determine the convex edge unit relative to the face r Is it an inner loop or an outer loop? If it is an outer loop, set i=i+1 and return to step (4-2). If it is an inner loop, go to step (4-24); (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); (4-25) Use the hole unit face group set {holeunit} to construct the hole unit hole_unit, as shown in Figure 6, and add the hole unit hole_unit to the hole unit set {holeunit c }, set i=i+1 and return to step (4-2).
6. The assembly hole alignment detection method based on geometric reasoning according to claim 5, characterized in that: 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 , the tth hole unit holeunit t Add to hole featurehole t Inside, the hole feature hole t The convex edge group is the tth hole unit holeunit t The convex edge group {edgeunit t }, hole feature hole t The axial vector is the holeunit t The axial vector of the hole feature t Add to the hole feature set {hole}; (5-4) Set t = t + 1, and return to step (5-2); (5-5) Set counters j = 1, k = 2; (5-6) Determine whether j < hole feature number hole_size holds. If so, get the jth hole feature hole from the hole feature set {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 the jth hole feature hole j The axial vector of the kth hole feature hole k Are the axial vectors of coaxial? If yes, proceed to step (5-9); otherwise, set k=k+1 and return to step (5-7); (5-9) Determine the jth hole feature hole j The convex edge group set {edgunit j } and the kth hole feature hole k The convex edge set {edgeunit k }, if not, set k = k + 1 and return to step (5-7); if so, set the same convex edge unit edge unit same From the convex edge group set {edgeunit j } and the convex edge set {edgeunit k } and set the convex edge group set {edgeunit k } to add the elements in the convex edge group set {edgeunit j }, then go to step (5-10); (5-10) The kth hole feature hole k holeunit k Add to hole feature jth hole j In the convex edge group set {edgeunit j }Updated to the jth hole feature hole j The convex edge set {edgeunit j }, and delete the kth hole feature hole from the hole feature set {hole} k , then return to step (5-7).
7. The assembly hole alignment detection method 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 u ≤ the total number of elements in the hole feature set {hole}, holesize. If so, get the uth hole feature hole in the hole feature set {hole} u , and go to step (6-3); otherwise the process ends; (6-3) Get the u-th hole feature hole u The corresponding number of hole units (as shown in Figure 7). If there is only one hole unit, it means that the u-th hole feature hole u For a simple hole, the simple hole is divided into a simple cylindrical hole or a simple tapered hole according to the type of the side surface in the hole unit; if there are two hole units, the hole feature is divided into a countersunk hole and a countersunk hole according to the type of the hole unit with a larger aperture; if there are more than two hole units, it means that the hole feature is a composite hole, in which case the axial vector of the first hole unit inside is taken as the uth hole feature hole u The axial vector holevec u , then go to step (6-4); (6-3) Get the u-th hole feature hole u The corresponding hole unit set {unit u }, from the hole unit set {unit u }Get the first hole unit holeunit begin , the hole unit holeunit begin The axial vector is the u-th hole feature hole u axial vector, and then go to 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) Determine the u-th hole feature hole u The corresponding hole unit set {unit u } is the number of all hole units unitsize equal to 1, if not, go to step (6-6); otherwise, it means the hole feature hole u is a simple hole, and determines the hole unit set {unit u The first hole unit holeunit begin The type of the first face is cylindrical or conical. If it is cylindrical, it means the hole feature is hole. u For a simple cylindrical hole, go to step (6-7). If it is a conical surface, it means the hole feature is hole. u For a simple tapered hole, go to step (6-7); (6-6) Determine the u-th hole feature hole u The hole unit set {unit 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); (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; (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); (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); (6-10) Obtain the set of machined surfaces {machinedface u} to get the number of machined surfaces machinedfacesize in it, and determine whether there exists 0 < machinedfacesize ≤ 2. If so, go to step (6-11); otherwise, u = u + 1 and return to step (6-2); (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); (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 , as shown in Figure 8; (6-13) Set u = u + 1, and return to step (6-2).
8. The assembly hole alignment detection method based on geometric reasoning according to claim 7, characterized in that: Step (7) includes the following sub-steps: (7-1) Set counters c = 1, d = 2, and initialize the set of assembly hole features {assemblyholes} to be empty; (7-2) Determine whether c < the total number of sub-parts in the assembly part_size. If so, obtain the hole feature set {hole c }, and go to step (7-3); otherwise the process ends; (7-3) Determine whether it holds that c < d ≤ part_size, the total number of sub-parts in the assembly. 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 there is a hole feature set corresponding to the cnt1 ≤ cth sub-part {hole c } is true, if so, get the cnt1th hole feature hole corresponding to the cth sub-part in the assembly cnt1 , set cnt2=1 and go to step (7-6); otherwise, set d=d+1 and return to step (7-3); (7-6) Determine whether there is a hole feature set {hole d } is true, if so, get the cnt2th hole feature hole corresponding to the dth sub-part in the assembly cnt2 , and go to step (7-7); otherwise, set cnt1=cnt1+1 and return to step (7-5); (7-7) Determine the cnt1th hole feature corresponding to the cth sub-part in the assembly cnt1 Is there an outgoing machining surface ID? out , if it does not exist, go to step (7-8); otherwise, go to step (7-9); (7-8) Determine hole characteristics cnt1 ID of the outgoing machining surface out With hole feature hole cnt2 ID of the entry machining surface in Are they parallel and the distance between them is smaller than the hole feature hole cnt2 If yes, go to step (7-11), otherwise go to step (7-9); (7-9) Determine the cnt2th hole feature corresponding to the dth sub-part in the assembly cnt2 Is there an outgoing machining surface ID? out , if it does not exist, set cnt2=cnt2+1 and return to step (7-6), otherwise go to step (7-10); (7-10) Determine hole characteristics cnt2 ID of the outgoing machining surface out With hole feature hole cnt1 ID of the entry machining surface in Are they parallel and the distance between them is less than the hole? cnt1 If not, set cnt2=cnt2+1 and return to step (7-6); otherwise, go to step (7-11); (7-11) The two hole features {hole cnt1 ,hole cnt2 }Add to the assembly hole feature set {assemblyholes}, set cnt2=cnt2+1, and return to step (7-6).
9. The assembly hole alignment detection method based on geometric reasoning according to claim 8, characterized in that: Step (8) includes the following sub-steps: (8-1) Set counter o = 1; (8-2) Determine whether there is o ≤ the number of assembly hole features in the assembly hole feature set assemblyholes_size. If so, read the oth assembly hole feature assemblyholes o ; Otherwise the process ends; (8-3) Extract the oth assembly hole feature in the assembly hole feature set assemblyholes o The two hole features in the figure are obtained, and the axial vectors Vec1 and Vec2 of the two hole features are obtained respectively; (8-4) Calculate the distance dis between Vec1 and Vec2, and determine whether the distance dis≤0.001mm. If so, it means that the two axial vectors are coaxial, that is, the oth assembly hole feature assemblyholes o The two holes are aligned; otherwise, it indicates that the oth assembly hole feature assemblyholes o The two holes in are not aligned and need to be adjusted, as shown in FIG9 , and then proceed to step (8-5); (8-5) o = o + 1, and return to step (8-2).
10. An assembly hole alignment detection system based on geometric reasoning, characterized in that: Includes: 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 perform vertex optimization processing and edge optimization processing on the Brep data of each sub-part in the assembly obtained by the first module in sequence to obtain the optimized Brep data corresponding to the sub-part; The third module is used to obtain each edge in the optimized Brep data corresponding to the sub-part obtained by the second module for each sub-part in the assembly obtained by the first module, obtain the concavity and convexity of the edge based on the connection conditions 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 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 for each sub-part in the assembly obtained by the first module; The fifth module is used to obtain, for each sub-part in the assembly obtained by the first module, a hole feature set corresponding to the sub-part based on a hole unit set corresponding to the sub-part obtained by the fourth module. The sixth module is used to obtain the type and the ID of the inward machining surface of each hole feature in each sub-part in the assembly obtained by the first module according to the hole feature set corresponding to the sub-part obtained by the fifth module. in , Outbound processing surface ID out and the axial vector V; The seventh module is used to obtain the type and the ID of the machining surface of each hole feature corresponding to each sub-part in the assembly according to the sixth module. in , Outbound processing surface ID out And the axial vector V, obtain the assembly hole feature corresponding to the assembly. 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
Partitioning of 3D CAD models
CN116226947A
Machining feature recognition method for plate parts
CN116403207A
Method and system for judging bending and flattening interference of sheet metal part based on three-dimensional model
CN116561982A
Three-dimensional geometric feature automatic identification method based on topology rule
CN117113455A
Analysis and identification method for geometric topological features of three-dimensional model
CN117290290A
