A processing feature identification method for plate parts
By using Python OCC to identify the machining features of plate-type parts, the problem of high development costs and licensing interruptions in commercial 3D software has been solved, achieving high accuracy and low cost feature recognition, and adapting to the flexible needs of enterprises.
Patent Information
- Application Number
- CN202310394320.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-04-13
AI Technical Summary
The high cost of secondary development of existing commercial 3D software and the potential for license interruption lead to high and unsustainable costs for identifying machining features of plate-type parts.
Using the open-source geometry engine Python OCC, the system imports STEP files of plate-type parts, performs geometric topology preprocessing, calculates the concavity and convexity of edges, constructs an attribute adjacency graph and decomposes it into meta-features, and matches the feature library to identify machining features.
It achieves high-accuracy processing feature recognition, reduces enterprise costs, ensures the continuous availability and flexibility of the system, and adapts to the actual needs of enterprises.
Smart Images

Figure CN116403207B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of workpiece machining feature recognition technology of numerical control machine tools, and particularly relates to a machining feature recognition method for plate parts. BACKGROUND
[0002] With the rapid development of modern industry and innovative product design, plate parts have complex and variable shapes. Enterprises must quickly respond to market demand, shorten product development and production cycles, improve product quality and production efficiency, and thus reduce the cost of single parts. Machining feature recognition, as one of the important technologies in CAPP integration, accurately extracts the required machining features from the STEP file model, which is the basis of the CAPP system. CAPP refers to computer-aided process planning.
[0003] Currently, machining feature recognition technology is mainly based on secondary development of commercial three-dimensional software. The developed machining feature recognition system uses a computer to automatically analyze the three-dimensional model of a part. However, there are two drawbacks to the secondary development of commercial three-dimensional software: 1. The cost is too high. Software companies have a single charging mode. Even if an enterprise only needs part of the software's functionality, it must pay for the entire software, and the cost may increase at any time. 2. The software development license may be discontinued, causing production and development to be interrupted.
[0004] Python OCC is a development platform based on Python language encapsulating Open CASCADE. Using Python OCC as the geometric kernel of the machining feature recognition system can not only read the STEP neutral file information of the part, but also use the rich data analysis library in Python language to develop the system conveniently and efficiently. Moreover, Python OCC is open source and free.
[0005] After searching, it was found that patent publication CN114925475A has the core content of a machining feature recognition method based on AAG of an MBD model. The MBD model established in Creo software is the basis, the information of the MBD model is extracted, the AAG of the MBD model is constructed, the feature subgraph is obtained by decomposing the AAG, the feature subgraph is matched with the predefined feature, and the recognition of the machining feature is realized. In addition, invention patent publication CN114694139A has the core content of extracting the semantic information of the description statement through the corresponding structure part model and the description statement of the structure part to be recognized, obtaining the target image set corresponding to the structure part to be recognized according to the target semantic information and the structure part model, and recognizing the machining feature of the structure part to be recognized according to the structure part image set, the target semantic information, and the pre-trained machining feature recognition model to obtain the target machining feature information corresponding to the structure part to be recognized and output.
[0006] The above technical solutions do not solve the identification problem of plate parts, in order to solve the above problems, it is necessary to develop a plate part machining feature recognition system by using open source geometric engine Python OCC. SUMMARY
[0007] The technical scheme of the present application is to solve the problems pointed out in the prior art, and the present application provides a plate part machining feature recognition method based on geometric engine Python OCC, comprising the following steps:
[0008] S1: import the STEP neutral file of the plate part model into Python OCC.
[0009] S2: obtain the point, line, surface and other geometric topology information of the part model, preprocess the geometric topology information, and calculate the concave-convexity of the edge.
[0010] S3: identify the transition feature according to the classification recognition method.
[0011] S4: construct an attribute adjacency graph through a predefined rule and store it in the form of an adjacency matrix.
[0012] S5: decompose the adjacency matrix into multiple elementary features according to the boundary relationship and the concave-convexity of the edge.
[0013] S6: match the elementary features with the feature library.
[0014] S7: obtain the machining feature.
[0015] S8: determine the step feature and other features through a predefined rule.
[0016] S9: end the process.
[0017] Preferably, the transition feature is a chamfer or a round corner.
[0018] Preferably, the chamfer is connected by one or more transition surfaces, and the transition surfaces are divided into planes and conical surfaces.
[0019] Preferably, the round corner is connected by one or more transition surfaces, and the transition surfaces are divided into cylindrical surfaces, annular surfaces and spherical surfaces.
[0020] Preferably, the preprocessing in S2 step obtains the information of surface, edge, ring and point, and encodes them uniquely, encodes the surface and edge using the geometric topology information, and encodes the ring and point using the hash algorithm.
[0021] The patent relates to a plate part machining feature recognition method, which has the advantages of high accuracy, convenient use, high flexibility and the like, enterprises can select a machining feature library suitable for their own needs according to their actual needs, greatly reducing the use cost of enterprises, and since it is based on the open source free geometric engine PythonOCC, it can be continuously used, and the situation that the enterprise production is affected by the inability to use in the middle of the way will not occur. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 A plate part machining feature recognition method flow chart.
[0023] Figure 2 It is a schematic diagram of the geometric topology information structure of the STEP neutral file.
[0024] Figure 3 It is a concave-convex judgment schematic diagram of the intersection of a plane and a plane as a straight line.
[0025] Figure 4 It is a concave-convex judgment schematic diagram of the intersection of a plane and a cylindrical surface as a straight line.
[0026] Figure 5 It is a concave-convex judgment schematic diagram of the intersection of a plane and a cylindrical surface as a circular arc.
[0027] Figure 6 It is a concave-convex judgment schematic diagram of the intersection of a cylindrical surface and a conical surface as a circular arc.
[0028] Figure 7 It is a plate part machining feature classification diagram.
[0029] Figure 8 It is a model schematic diagram with a fillet feature.
[0030] Figure 9 It is a model schematic diagram with a chamfer feature.
[0031] Figure 10 It is a cylindrical surface transition surface recognition flow chart.
[0032] Figure 11 It is a simple through hole feature diagram.
[0033] Figure 12 It is a plate part three-dimensional model.
[0034] Figure 13 It is a plate part attribute adjacency graph
[0035] Figure 14 It is a plate part adjacency matrix schematic diagram.
[0036] Figure 15 It is a plate part model composition schematic diagram.
[0037] Figure 16 is the schematic diagram of the inner and outer boundary relationship.
[0038] Figure 17 is the schematic diagram of the concave-convex of the edge.
[0039] Figure 18 is the schematic diagram of the machining feature recognition process.
[0040] Figure 19 is the schematic diagram of the step hole feature recognition process.
[0041] Figure 20 is the schematic diagram of the top surface, bottom surface and outer contour recognition process. DETAILED DESCRIPTION
[0042] The technical solutions of the present application will be described in detail below to better understand the technical solutions of the present application.
[0043] Please refer to Figure 1 A machining feature recognition method for plate parts, based on the geometry engine PythonOCC, including the following steps:
[0044] S1: Import the STEP neutral file of the plate part model into Python OCC.
[0045] S2: Obtain the point, line, surface and other geometric topology information of the part model, preprocess the geometric topology information, and calculate the concave-convex of the edge.
[0046] S3: Identify the transition feature according to the classification recognition method.
[0047] S4: Construct an attribute adjacency graph through predefined rules, and store it in the form of an adjacency matrix.
[0048] S5: Decompose the adjacency matrix into multiple elementary features according to the boundary relationship and the concave-convex of the edge.
[0049] S6: Match the elementary features with the feature library.
[0050] S7: Obtain the machining feature.
[0051] S8: Determine the step feature and other features through predefined rules.
[0052] S9: End the process.
[0053] The above steps and principles will be described in detail as follows:
[0054] I. Geometric topology information - 3D model data exchange standard STEP
[0055] Please refer to Figure 2STEP / AP203 geometry topology information structure.
[0056] STEP (Standard for the Exchange of Product Model Data) is a series of ISO 10303 standards, which is an international standard for data exchange between product models described by different computers; AP203 protocol is issued by ISO in 1994, the product information described by AP203 protocol can be divided into geometry information and topology information, the common geometry topology information of STEP / AP203 is:
[0057] (1) Point (POINT): mainly Cartesian point (CARTESIAN_POINT).
[0058] (2) Curve (CURVE): mainly straight line (LINE), circle (CIRCLE), ellipse (ELLIPSE), B-spline curve (B_SPLINE_CURVE).
[0059] (3) Surface (SURFACE): mainly plane (PLANE), cylindrical surface (CYLINDRICAL_SURFACE), conical surface (CONICAL_SURFACE), spherical surface (SPHERICAL_SURFACE), toroidal surface (TOROIDAL_SURFACE), B-spline surface (B_SPLINE_SURFACE).
[0060] (4) Position (PLACEMENT): mainly 3D space 2 direction axis (AXIS2_PLACEMENT_3D).
[0061] (5) Direction (DIRECTION): three coordinate values determine the direction.
[0062] (6) Vector (VECTOR): three coordinate values and length value together determine the direction and size of the vector.
[0063] II. Information preprocessing
[0064] In Python OCC, there is a DataExchang module mainly used for processing various types of files, in which the read_step_file function is used to read the.STEP model file and build it into a solid (hereinafter referred to as shape). The TopologyExplorer class is used to parse the shape, and its face method can traverse all the faces of the shape, the wires_from_face method can traverse all the loops of the face, in which the last loop information obtained by the current face traversal is the outer boundary of the face, the edges_from_face method can traverse all the edges of the face, the edges_from_wire method can traverse all the edges of the loop, and the vertices_from_edge method can traverse all the vertices of the edge.
[0065] After using the above method to obtain the information of faces, loops, lines, and points, the information result of the face is <class 'TopoDS_Face'>, the information result of the loop is <class 'TopoDS_Wire'>, the information result of the edge is <class 'TopoDS_Edge'>, and the information result of the point is <class 'TopoDS_Vertex'>, all of which belong to the TopoDS class. Taking the face as an example, after obtaining the information of the face, it cannot be directly determined which specific face is obtained, therefore, for different topological information, it is necessary to uniquely encode it, and for faces and edges, it is encoded by using geometric topological information, and for loops and points, it is encoded by using a hash algorithm.
[0066] III. Concave-convex judgment of edge
[0067] The edge is a topological entity connecting two faces, and the concave-convex relationship of the edge is reflected in the spatial relationship between adjacent faces. Since there are many cases of face intersection, the concave-convex judgment of the edge needs to be divided into many cases.
[0068] (1) Intersection of plane and plane is a straight line
[0069] Please refer to Figure 3 , the outer normal vectors of plane f1 and plane f2 are n1 and n2 respectively, and the two faces have a common edge straight line e. Take f1 as the base face, and determine the normal vector of the common edge e as ne by the right-hand screw method. The value of the intermediate vector n is calculated by formula 3-1.
[0070] n = n e × n2 (3-1)
[0071] Calculate the angle θ between the normal vector n1 of the face f1 and the intermediate vector n. When the angle is less than 90 degrees, it is determined that the common edge e is a concave edge; when the angle When the angle θ is greater than 90°, the common edge e is determined as a convex edge. The calculation formula of the angle θ is shown in formula 3-2, wherein, the normal vector n1 of the plane f1 is (A, B, C), and the intermediate vector n is represented as n = (X, Y, Z).
[0072]
[0073] (2) The intersection of a plane and a cylindrical surface is a straight line
[0074] Please refer to Figure 4 When the intersection of a plane and a cylindrical surface is a straight line, the normal vector of the plane f1 is denoted as n1, and an arbitrary vertex k of the common edge e is taken, and the directional quantity of the vertex k pointing to the center o of the current arc is denoted as n2, and then the angle θ is calculated according to formula 3-2. When the angle θ is greater than 90°, the common edge e is determined as a concave edge; and when the angle θ is less than 90°, the common edge e is determined as a convex edge.
[0075] (3) The intersection of a plane and a curved surface is an arc
[0076] Please refer to Figure 5 The curved surface mainly includes a cylindrical surface and a conical surface, and the following is analyzed by taking a plane and a cylindrical surface as an example. As shown in Figures 3-7 , the normal vector of the plane f1 is denoted as n1, the two arc center points of the cylindrical surface are o1 and o2, and the midpoint between the two points is denoted as point o. An arbitrary point P is taken in the plane f1, the directional quantity of the point P pointing to the center point o is denoted as n2, and then the angle θ is calculated according to formula (3-2). When the angle θ is greater than 90°, the common edge e is determined as a concave edge; and when the angle θ is less than 90°, the common edge e is determined as a convex edge.
[0077] (4) The intersection of a cylindrical surface and a conical surface is an arc
[0078] Please refer to Figure 6 The directional quantity of the cylindrical surface f1 is denoted as n1, and the directional quantity of the conical surface f2 is denoted as n2, and then the angle θ is calculated according to formula 3-2. When the angle θ is greater than 90°, the common edge e is determined as a concave edge; and when the angle θ is less than 90°, the common edge e is determined as a convex edge.
[0079] Four, processing features of plate parts
[0080] Please refer to Figure 7 According to the processing feature classification of plate parts, six major features are mainly divided: groove features, hole features, boss features, step features, transition features and other features; among them, groove features mainly include through groove, blind groove, open groove, key groove; hole features include through hole, blind hole, tapered hole, countersunk hole; boss features include cylindrical boss and square boss; step features include through step and blind step, transition features include chamfer, round corner; other features include top surface, bottom surface and outer contour, the above-mentioned 17 processing features are taken as the identification target, the protection scope of the patent is not limited to the above-mentioned features, such as key groove can be divided into key through groove and key blind groove.
[0081] V. Transition feature classification and identification
[0082] The chamfer and round corner in the technical solution of the patent are collectively referred to as transition features, the transition features are auxiliary features, which change the geometric topological relationship of the model, increase the complexity of the topological relationship between the feature surfaces, and increase the difficulty of processing feature identification, therefore, before processing feature identification, the transition features in the plate part model are identified first, the transition features are connected by one or more transition surfaces, in order to identify the transition features contained in the plate part model, all the transition surfaces are identified first.
[0083] The geometric topological structures of different types of transition surfaces in the round corner are different, according to the classification of the round corner features, the transition surfaces can be divided into cylindrical surface, torus surface and spherical surface.
[0084] (1) Cylindrical surface
[0085] Please refer to Figure 8 When the edge type is a straight line, the chamfer operation is performed, and the face type of the chamfer is a cylindrical surface. For example, the faces f1, f3, f6, f9, f10, f12, f13, f18, f20 in Figure 8 The cylindrical surface as the transition surface has two smooth straight line edges, the two straight line edges are respectively adjacent to two non-parallel planes, and the two straight line edges are both convex properties; for example, the faces f5, f15, f17 in Figure 8 The straight line edges are both concave properties, and the flat bottom R tool is often used for processing in the groove feature.
[0086] (2) Spherical surface
[0087] If the intersection point of the three edges is subjected to the equal-radius chamfer operation, the vertex may form a spherical surface, for example, the faces f2, f8, f19 in Figure 8 The spherical surface as the transition surface has and only has three arc edges, the lengths of the three arc edges are equal, and the adjacent surfaces of the arc edges are both cylindrical surfaces belonging to the transition feature, the arc edges of the spherical surface of this type of transition feature are defined as convex properties; for example, the face f16 in Figure 8 The arc edges of the spherical surface are defined as concave properties.
[0088] (3) Torus
[0089] When the edge type is circular arc, the fillet operation is performed, and the transition surface type is torus, such as the surface f7 in Figure 8 , or the same is true for the equal-radius fillet operation of the intersection of three edges, which may form a torus, such as the surfaces f4, f11, f14 in Figure 8 . As a transition surface, if the adjacent surface contains other types of transition surfaces, such as cylindrical surface type, it is determined that the torus is a transition surface; when there is no other type of transition surface in the adjacent surface, the radius of the torus is obtained using the MinorRadius function, and then the machining radius of the forming tool is judged, if the radius of the torus is equal to the machining radius of the forming tool, it is determined that the surface is a transition surface, and the edges of such transition feature torus are defined as convex properties.
[0090] Please refer to Figure 9 , according to the chamfer feature, the transition surface can be divided into plane and cone.
[0091] (1) Plane
[0092] When the edge type is straight line, the chamfer operation is performed, and the transition surface type is plane. When the number of edges contained in the plane is equal to 3 and the lengths of the straight edges are equal, it is defined as a transition surface, such as the surfaces f2, f6, f12 in Figure 9 , and it is determined that the plane adjacent to the straight edge is also a transition surface, such as the surfaces f1, f3, f4, f7, f8, f9, f10, f11, f13 in Figure 9 .
[0093] (2) Conical surface
[0094] When the edge type is circular arc, the chamfer operation is performed, and the transition surface type is conical surface, such as the conical surface f5 in Figure 9 . When the number of edges contained in the conical surface is 2 and both are circular arc edges, the small radius r of the conical surface is obtained using the RefRadius function, and the absolute value of the 9th element of the Coefficients function result is obtained, and then the machining radius of the forming tool is judged, if the value of R-r is equal to the edge length of the forming tool, it is determined that the conical surface is a transition surface, when the major radius R and the small radius r of the conical surface are equal to the major radius and the small radius of the conical surface of the standard counterbore hole in GB, it is not determined as a transition surface, the following table shows the size of some standard counterbore hole features.
[0095] Table 3-1 Major and small radii of some standard counterbore holes
[0096]
[0097] Please refer to Figure 10 , the identification of transition features
[0098] The transition surface is identified according to the classification identification and rule matching method, when identifying a certain type of transition surface, firstly, all the surfaces of the part model are traversed, the type of the surface is judged, and the set of the same surface type is established; then the rule is adopted to judge whether the surface is the transition surface of the type; finally, the transition surface and its adjacent surface are recorded. The identification process of different transition surface types is similar, taking the cylindrical surface type transition surface as an example,
[0099] The specific steps are as follows:
[0100] Step 1: traverse all the surfaces of the part model, find out the cylindrical surface type, and add it to the surface set F={f1,f2,...,fn}, the length of the surface set F is n, and the conversion is completed to step 2. n} in the surface set F, and the conversion is completed to step 3; when the length n of the surface set is 0, the conversion is completed to step 7.
[0101] Step 2: when the length n of the surface set F is not equal to 0, take out a cylindrical surface fi in order, delete the cylindrical surface fi in the surface set F, and convert to step 3; when the length n of the surface set is 0, convert to step 7.
[0102] Step 3: judge whether the cylindrical surface fi has two straight line edges, if yes, convert to step 4; otherwise, convert to step 2.
[0103] Step 4: judge whether the two straight line edges of the cylindrical surface fi are convex, if yes, convert to step 5; otherwise, convert to step 2.
[0104] Step 5: judge whether the two adjacent planes of the two straight line edges are parallel, if not, convert to step 6; if yes, convert to step 2.
[0105] Step 6: the cylindrical surface fi is a transition surface, add it to the cylindrical surface type transition surface set F'={f1,f2,...,fn}, extract the curvature radius from the surface parameters of the cylindrical surface fi, record the transition surface and its adjacent surface, and complete the conversion to step 2. m} in the surface set F, and the conversion is completed to step 3; when the length n of the surface set is 0, the conversion is completed to step 7.
[0106] Step 7: the cylindrical surface type transition surface identification is completed, and the process is ended.
[0107] Then it is necessary to judge whether it is a complete cylindrical surface, and exclude the possibility of being a transition surface
[0108] Please refer to Figure 11 , Figure 11is a simple through-hole feature, the model is analyzed, and the number_of_wires_from_face function is used to determine that the type of the face is: GeomAbs_Cylinder, and the number of rings is 1, indicating that the cylindrical face only has 1 ring. By judging the number of edges of the cylindrical face, it can be determined that the face is a complete cylindrical face, which includes 2 circular arcs and 1 B-spline curve, or 2 circular arcs and 1 straight line, where the length of the B-spline curve or straight line is the depth of the hole; the type and number of edges of the cylindrical face and the height judgment; the type of the face is: GeomAbs_Cylinder, the number of edges is 3, and the type of the edge is: GeomAbs_Circle, GeomAbs_BSplineCurve, and the length of the edge is 62.0.
[0109] Six, construction of attribute adjacency graph
[0110] Attribute adjacency graph (AAG) is a feature recognition method based on graph, where nodes represent faces of a part model, and arcs connect adjacent faces. To perform feature recognition, the attributes of arcs need to be defined according to the concave-convex properties of edges.
[0111] Please refer to Figure 12 , each face in the part model corresponds to a node in the attribute adjacency graph, and the arc between two nodes corresponds to an edge in the part model. Figure 12 A three-dimensional model of a plate part is used as an example. Each face is numbered as fn, where n = 1-44, representing the face unit of the part model. Figure 12 The numbering of each face in the part model is self-coded in a certain order, not in the order of reading the face in Python OCC.
[0112] Please refer to Figure 13 , where nodes represent faces of a part model, and arcs represent adjacent faces. The numbers on the arcs represent the concave-convex properties of the edges; 0 represents the concave property of the edge, and 1 represents the convex property of the edge.
[0113] AAG uses the NumPy library to store the adjacency matrix. NumPy is a Python library for handling arrays. NumPy provides array objects that are 50 times faster than traditional Python lists, and arrays can be used to handle large matrices. This patent proposes a method to construct the adjacency matrix of AAG using the internal and external boundary relationships of adjacent faces, face and edge attribute values, and the concave-convex properties of edges. The specific scheme is as follows:
[0114] (1) For the diagonal elements a i,j(i = j). The face attribute values defined in the class GeomAbs_SurfaceType can be used directly, where 0 represents a plane, 1 represents a cylindrical surface, 2 represents a conical surface, 3 represents a spherical surface, and 4 represents a toric surface. Some of the face attribute values are shown in the following table.
[0115] Definition of the type attribute of the face
[0116]
[0117] (2) For the non-diagonal elements a i,j (i≠j). When the face fi is adjacent to the face fj, the relationship between the two adjacent faces is described by different positions of the element value, which is defined as follows: the unit digit represents a concave edge with 0 and a convex edge with 1; the following table shows the definition of the type attribute of the edge, and the edge attribute values in the class GeomAbs_CurveType are added by 1, respectively. The ten digits represent a straight line, a circular arc, an elliptical arc, and a B-spline curve with 1, 2, 3, and 4, respectively. Otherwise, some matrix elements will be ambiguous when constructing the adjacency matrix; the hundred digits represent that the adjacent edge of the face fi and the face fj is the inner boundary of the face fi with 1; the thousand digits represent that the adjacent edge of the face fi and the face fj is the outer boundary of the face fi with 1. When the face fi is not adjacent to the face fj, the matrix element is defined as -1.
[0118] For example, 1011 represents that the adjacent edge of the face fi and the face fj is the outer boundary of the face fi, the common edge is a straight line, and the edge is convex; 121 represents that the adjacent edge of the face fi and the face fj is the inner boundary of the face fi, the common edge is a circular arc, and the edge is convex; and 11 represents that the adjacent edges of the face fi and the face fj are both outer boundaries, the common edge is a straight line, and the edge is convex.
[0119] Definition of the type attribute of the edge
[0120]
[0121]
[0122] According to the above rules, the AAG is stored using the NumPy library. Please refer to Figure 14 , Figure 14 for the adjacency matrix of part of the AAG. Figure 13
[0123] For the decomposition of the attribute adjacency graph, please refer to Figure 15 . Machining feature recognition starts from the geometric entity of the part. The model can be divided into multiple composite features and elementary features. The elementary feature is the most basic geometric shape that constitutes the part, and the elementary feature cannot be further refined and decomposed. In order to improve the accuracy of machining feature recognition, the adjacency matrix of the AAG needs to be decomposed into the smallest adjacency matrix of multiple elementary features. This patent uses the boundary relationship and the concave-convex property of the edge as the judgment criterion for the decomposition of the adjacency matrix.
[0124] (1) Boundary relationship
[0125] Please refer to Figure 16 , each face in the model has an outer boundary, or one or more inner boundaries. The outer boundary of the blind hole coincides with the inner boundary of the plane, and the composite feature can be decomposed into two parts of the plane and the blind hole.
[0126] (2) Concave and convex of edge
[0127] Please refer to Figure 17 , each edge in the model has concave and convex properties, and the adjacency matrix of AAG is decomposed by the concave and convex of edge, and the edge properties in each element feature only contain concave or convex relationship.
[0128] To prevent ambiguity of the minimum adjacency matrix, the following rules are defined: if the edges of the element feature are all concave, define the feature type T of the element feature as 1; if the edges of the element feature are all convex, define the feature type T of the element feature as 2; if the number of elements of the feature matrix of the element feature is 1, define the feature type T of the element feature as 3. By using the above method to decompose the adjacency matrix of AAG, a plurality of minimum adjacency matrices of element features are obtained, as shown in the following table.
[0129] Minimum adjacency matrix of element feature and its unique variable
[0130]
[0131]
[0132] Regarding the recognition of machining features: after obtaining the minimum adjacency matrix of the element feature, it needs to be parsed and the variable aag_code of the minimum adjacency matrix is calculated, which aims to effectively reduce the difficulty and time of matrix matching algorithm, where aag_code is composed of the length of the diagonal element tra_len and the sum of the diagonal elements tra_sum. The construction of the feature library has openness and scalability, which can be established or based on the existing feature library, and continuously expand the feature library combined with specific instance analysis. Through a large number of plate part instance analysis, a feature library for plate parts is constructed, and the following table shows part of the typical feature names in the feature library and their matrix variables V.
[0133] Part of the typical feature names in the feature library and their matrix variables
[0134]
[0135] The machining feature recognition process is shown in Figure 18 .
[0136] The specific steps are as follows:
[0137] Step 1: decompose the adjacency matrix of AAG to obtain the minimum adjacency matrix A of the element feature, distinguish the feature type T according to the edge concave-convex property of the element feature, and calculate the matrix variable aag_code, and complete the transition to Step 2.
[0138] Step 2: match the matrix variable aag_code and the feature type T of the element feature with the feature library, if the feature matrix A is matched successfully, return the feature name, and transition to Step 3; if the matching fails, transition to Step 4.
[0139] Step 3: match the matrix variable aag_code and the feature type T of the next element feature with the feature library, if all features are identified, transition to Step 5.
[0140] Step 4: remind the artificial feature identification, and supplement the un-identified feature matrix variable to the feature library to complete the expansion; if all features have been identified, transition to Step 5.
[0141] Step 5: the processing feature identification is completed, and the process is ended.
[0142] According to the above steps, the element features in the type attribute definition table of the edge are matched with the feature library, element feature 1 is a through hole, element feature 2 is a blind hole, element feature 3 is a cylindrical boss, element feature 4 is a keyway, element feature 5 is an open slot, element feature 6 is a through slot, and element feature 7 is a blind slot.
[0143] Among the information contained in the part design, some element features are not real machining features, and these element features should be combined into one machining feature to meet the actual situation in the machining process. Therefore, after obtaining the element features, the element features need to be recombined, such as the stepped hole in the machining feature is composed of two element features, which may be a blind hole and a blind hole or a blind hole and a through hole. In order to identify the composite feature, the feature vector needs to be defined, and the direction vector of the cylindrical surface is taken as the feature vector. This patent takes the stepped hole feature as an example to give the corresponding combination processing method, as shown in Figure 19 The specific steps are as follows:
[0144] Step 1: traverse all machining feature information, obtain all through hole features and blind hole features, and add them to the hole feature set Fehole hole ={hole1,hole2,...,hole n}, transition to Step 2.
[0145] Step 2: select a blind hole feature holei from the hole feature set Fehole, remove the blind hole feature holei from the hole feature set Fehole, then judge the hole features with the same feature vector as the blind hole holei in the hole feature set Fehole, and add them to the new feature set Fe hole}, go to step 3; go to step 6 when there is no blind hole feature in the hole feature set Fehole. m}, go to step 3; go to step 6 when there is no blind hole feature in the hole feature set Fehole.
[0146] Step 3: The blind hole holei is judged with the hole feature holej in the set Fe hole one by one, and it is judged whether there is a common ring. If there is a common ring, the blind hole holei and the hole feature holej are combined to be identified as a stepped hole feature, and go to step 4; if there is no common ring, go to step 5.
[0147] Step 4: The hole feature holej is removed from the hole feature set Fehole, and go to step 5.
[0148] Step 5: The feature set Fe hole is emptied, and go to step 2.
[0149] Step 6: End.
[0150] Regarding the identification of other features:
[0151] In mechanical processing, most plate parts need to be processed on the top surface, the bottom surface and the outer contour, and the clamping frequency is reduced when clamping the blank, so after identifying part of the processing features, the top surface, the bottom surface and the outer contour need to be judged and identified. This paper defines the part top surface as the face with the most processing features, and the specific identification process is shown in Figure 20 , and the specific steps are as follows:
[0152] Step 1: Traverse all the faces in the part model to establish a face set F = {f1, f2,..., f n}, delete the processing feature faces and transition feature faces that have been identified, and obtain a new face set F' = {f1, f2,..., f m}, and go to step 2.
[0153] Step 2: Judge the normal vectors of each plane in the face set F', and extract and compose a new face set F k ' = {f1, f2,..., f i} with the same normal vectors, where k > 1, and go to step 3.
[0154] Step 3: Calculate the number of inner boundaries in each face set F k ', if the maximum number of inner boundaries of two or more face sets F k ' is the same, go to step 4; otherwise, the face set F k ' with the most inner boundaries is determined as the top surface set, and go to step 6.
[0155] Step 4: Calculate the face set F with the largest number of inner boundaries k The face set F with the smallest area_sum is the top face set, that is, the face set F k If all the feature faces in the face set F k ' are top faces, go to step 6; if there are two or more face sets F
[0156] Step 5: Take one of the face sets F k ' with the largest number of inner boundaries and the smallest area_sum as the top face, and go to step 6.
[0157] Step 6: After determining the top face, the face with the same normal vector as the top face normal vector is the bottom face; the remaining faces are the outer contour faces, and go to step 7. It should be noted that in Python OCC, the actual top face and bottom face have the same direction, so the judgment condition is the same normal vector.
[0158] Step 7: The top face, bottom face, and outer contour identification are completed, and the process ends.
[0159] The processing feature recognition method of the plate part related to the patent has the advantages of high accuracy, convenient use, high flexibility, etc. Enterprises can choose the processing feature library suitable for their own needs according to their actual needs, greatly reducing the use cost of enterprises, and because it is based on the open source and free geometry engine Python OCC, it can be used continuously and will not affect the production of enterprises.
[0160] The above is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields is included in the patent protection scope of the present application.
Claims
1. A machining feature identification method for sheet metal parts, based on a geometric engine Python OCC, comprising the following steps: S1: importing a STEP neutral file of a sheet metal part model into Python OCC; S2: obtaining point, line, and surface geometric topology information of the part model, preprocessing the geometric topology information to obtain surface, edge, loop, and point information, uniquely encoding the information, encoding the surface and edge using geometric topology information, encoding the loop and point using a hash algorithm, and calculating the concavity and convexity of the edge; the concavity and convexity calculation of the edge is divided into four cases: (1) the intersection of two planes is a straight line: the outer normal vectors of plane f1 and plane f2 are n1 and n2, respectively, and the two planes have a common edge straight line e, taking f1 as the base plane, determining the normal vector of the common edge e as ne by the right-hand screw method, and calculating the intermediate vector n by formula 3-1 to obtain the value of the intermediate vector n; n = n e x n2(3-1) The angle θ between the normal vector n1 of the calculation face f1 and the intermediate vector n is calculated, and when the angle θ is the common edge e is determined as a concave edge; when the angle θ is the common edge e is determined as a convex edge; and the calculation formula of the angle θ is shown in formula 3-2, wherein, the normal vector of surface f1 is n1 = (A, B, C), and the intermediate vector n is represented as n = (X, Y, Z); (2) the intersection of a plane and a cylindrical surface is a straight line: When the plane intersects the cylindrical surface as a straight line, the normal vector of the plane f1 is denoted as n1, and any vertex k of the common edge e is taken, and the directional quantity of the vertex k pointing to the center o of the current arc is denoted as n2, and then the included angle θ is calculated according to formula 3-2. When the included angle θ is , it is determined that the common edge e is a concave edge; when the included angle θ is , it is determined that the common edge e is a convex edge. (3) the intersection of a plane and a curved surface is a circular arc: The curved surface mainly includes cylindrical surface and conical surface, and the following analysis is made by taking the plane and the cylindrical surface as examples; the normal vector of the plane f1 is denoted as n1, the two center points of the circular arcs of the cylindrical surface are o1 and o2, and the midpoint between the two points is denoted as point o; a point P is randomly taken in the plane f1, the directional quantity of the point P pointing to the center point o is denoted as n2, and then the included angle θ is calculated according to formula (3-2); when the included angle θ is , it is determined that the common edge e is a concave edge; when the included angle θ is , it is determined that the common edge e is a convex edge; (4) the intersection of a cylindrical surface and a conical surface is a circular arc: The directional quantity of the cylindrical surface f1 is denoted as n1, and the directional quantity of the conical surface f2 is denoted as n2, and then the included angle θ is calculated according to the formula 3-2. When the included angle θ is , it is determined that the common edge e is a concave edge; when the included angle θ is , it is determined that the common edge e is a convex edge. S3: identifying transition features according to a classification identification method, the transition features being chamfers and round corners, the chamfers being connected by one or more transition surfaces, the transition surfaces being divided into planes and cones, the round corners being connected by one or more transition surfaces, the transition surfaces being divided into cylindrical surfaces, toric surfaces, and spherical surfaces; S4: constructing an attribute adjacency graph through predefined rules and storing it in the form of an adjacency matrix; S5: decomposing the adjacency matrix into multiple elementary features according to the boundary relationship and the concavity and convexity of the edge; S6: matching the elementary features with a feature library; S7: obtaining machining features and step features; S8: ending the process.
Citation Information
Patent Citations
Numerical control machine tool complex structural member machining feature identification method and system
CN114694139A
Processing feature identification method of MBD model based on AAG
CN114925475A
A method and a device for automatically identifying the manufacturing characteristics of a workpiece based on a single image
CN109242955A
Automatic feature identification method and device for die with lots of bosses and grooves
CN114140630A