Punching standard part parameter generation method and device
By determining the hole boundary and contour analysis in the reverse design of stamping dies, the parameters of the punched standard parts are generated, which solves the problem that the existing technology cannot automatically identify hole objects and realizes efficient and accurate automated generation of hole parameters.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI UNIV OF SCI & TECH
- Filing Date
- 2026-06-01
- Publication Date
- 2026-06-26
AI Technical Summary
In the reverse design of stamping dies, existing technologies cannot directly determine the specific location, contour shape, and other parameters of holes from the STL model, and cannot automatically identify hole objects, requiring reliance on existing process models and manual confirmation.
By determining the hole boundary based on the STL model, performing contour analysis and arc fitting, the hole type, geometric parameters, body center and normal vector are obtained. Combined with the unified selection of inlet parameters, the parameters of the punched standard part are automatically identified and generated.
It enables automatic identification of hole objects from discrete STL models, reducing manual processing workload, ensuring consistency and accuracy of results, avoiding reliance on existing process models and manual verification, and improving the processing efficiency of punched standard parts.
Smart Images

Figure CN122287005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of parameter generation technology, and in particular to a method and apparatus for generating parameters for punched standard parts. Background Technology
[0002] In the reverse design of stamping dies, after generating an STL (stereolithography) model based on the existing hole positions, it is not possible to directly determine the specific location, contour shape, and other parameters of the hole positions from the STL model. It is also impossible to determine the hole type, stamping direction, and standard parts required for manufacturing.
[0003] Existing processing methods typically require manual determination of the specific parameters of the stamping die based on the STL model. While existing CAD (Computer Aided Design) software or automated scripts can assist in hole design to some extent, they rely on existing process models, standard information interfaces, predefined punching coordinate systems, or manually confirmed process information during use. They cannot automatically identify hole objects from a discrete STL model when there is no existing process model or completed engineering annotations. Summary of the Invention
[0004] This invention provides a method and apparatus for generating parameters of punched standard parts, in order to solve the problem in the prior art that the specific parameters of stamping dies cannot be directly determined from the STL model in the reverse design scenario of stamping dies.
[0005] In a first aspect, embodiments of the present invention provide a method for generating parameters of a punched standard part, including: Based on the pre-acquired STL model, the hole boundary of each hole is determined; Contour analysis and circular arc fitting are performed on the boundary of each hole to obtain the hole shape, geometric parameters, body center and normal vector of each hole. Based on the hole type and geometric parameters of each hole, determine the unified selection inlet parameters for each hole. Based on the unified selection of inlet parameters, body center, normal vector, and standard parts library for each hole, determine the standard parts parameters of the punching standard parts for each hole.
[0006] Secondly, embodiments of the present invention provide a device for generating parameters for punched standard parts, comprising: The boundary determination module is used to determine the hole boundary of each hole position based on the pre-acquired STL model; The analysis module is used to perform contour analysis and arc fitting on the boundary of each hole position to obtain the hole shape, geometric parameters, body center and normal vector of each hole position; The parameter determination module is used to determine the unified selection inlet parameters for each hole position based on the hole type and geometric parameters of each hole position. The generation module is used to determine the standard part parameters of the punching standard part for each hole position based on the unified selection entry parameters, body center, normal vector and standard part library for each hole position.
[0007] In this embodiment of the invention, the boundary of each hole position is determined by pre-acquired STL model, which can accurately identify all target hole positions that need to be processed and eliminate interference from irrelevant content. Then, contour analysis and arc fitting are performed on the boundary of each hole position to clearly extract the hole type, geometric parameters, body center for positioning, and normal vector for determining direction of each hole. This transforms the STL model data, which originally could only express the appearance shape, into effective information that can be directly used for subsequent calculations. Then, a unified selection entry parameter is determined according to the hole type and geometric parameters of each hole, so that hole positions of different hole types can be adapted to the same set of selection rules. Finally, by combining the unified selection entry parameter, body center, normal vector, and standard parts library of each hole position, the standard parts parameters of the corresponding punching standard parts can be accurately determined. Without relying on existing process models and completed engineering annotations, hole position objects can be automatically identified from discrete STL models. This can significantly reduce the workload of manual hole-by-hole processing and table lookup calculations, and can also stably ensure the consistency and accuracy of the processing results of all hole positions. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the implementation of the method for generating parameters for punched standard parts provided in this embodiment of the invention. Figure 2 This is a schematic diagram of the closed-chain generation method for generating parameters of punched standard parts provided in this embodiment of the invention; Figure 3 This is a schematic diagram of the only side of the method for generating parameters of punched standard parts provided in the embodiments of the present invention; Figure 4 This is a flowchart illustrating the implementation of step S120 of the method for generating parameters of punched standard parts provided in this embodiment of the invention. Figure 5 This is a schematic diagram illustrating the determination of the body center in the method for generating parameters of punched standard parts provided in this embodiment of the invention; Figure 6 This is a schematic diagram of the modified initial normal vector of the method for generating parameters of punched standard parts provided in the embodiments of the present invention; Figure 7 This is a schematic representation of the side punching angle configuration of the punching standard part parameter generation method provided in the embodiments of the present invention; Figure 8 This is a schematic diagram of the unified selection of inlet parameters for different hole types in the method for generating parameters of punched standard parts provided in this embodiment of the invention; Figure 9This is a schematic diagram of the structure of the punching standard part parameter generation device provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0009] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0010] See Figure 1 The flowchart illustrating the implementation of the method for generating parameters of punched standard parts provided in this embodiment of the invention is described in detail below: Step S110: Determine the hole boundary for each hole position based on the pre-acquired STL model.
[0011] In some embodiments, see Figure 2 STL models refer to discrete triangular facet models used in reverse engineering scenarios. These models only contain basic geometric appearance information and lack engineering semantic information. Hole boundaries refer to the closed inner boundaries corresponding to stamping holes, and are the fundamental target objects for all subsequent processing steps.
[0012] It should be noted that when determining the hole boundary of each hole location based on the STL model, not all boundaries in the STL model are considered equally important data. Instead, the boundary chains that truly constitute the hole location object are first screened out based on topological connectivity, closure features, and boundary semantic rules. This ensures that the calculation revolves around the design focus from the beginning, rather than being interfered with by noise and irrelevant edges in the original data.
[0013] In one possible implementation, step S110 is specifically processed as follows: deduplicating the mesh vertices of multiple meshes in the pre-acquired STL model, and selecting multiple unique edges from the connections between the multiple mesh vertices after vertex deduplication; linking the multiple unique edges into multiple closed chains using adjacency tracing; determining the closed chain with the longest length as the outer contour of the part, and determining the remaining closed chains as candidate inner boundaries; and determining the candidate inner boundaries whose length does not exceed a preset length threshold as the hole boundaries of each hole.
[0014] In some embodiments, vertex deduplication refers to removing duplicate vertices with the same position from the mesh of the STL model. A unique edge refers to an edge that is not shared with any other triangle after vertex deduplication, selected from all the edges of the triangles in the STL model. Figure 3 As shown, Figure 3 In the diagram, edges 1, 2, 3, 4, and 5 are unique edges, while the others are not unique. Adjacency tracing refers to connecting unordered boundary edges sequentially through their adjacency relationships to form a continuous closed chain. The process of generating a closed chain using adjacency tracing is as follows: Figure 2As shown. For each closed chain, its overall length needs to be calculated, and the closed chain with the longest length is determined as the outer contour of the part. The remaining chains are used as candidate inner boundaries. At the same time, an upper limit is set for the length of the inner boundaries. Candidate inner boundaries exceeding the threshold are not included in the hole position analysis and are only used as auxiliary display objects. The preset length threshold is the maximum circumference of the punch used for punching (i.e., the standard part), and the preset length threshold can be set to 90mm. Through this process, subsequent calculations are focused on objects that are actually likely to be punching holes, rather than mechanically treating all boundaries indiscriminately.
[0015] It should be noted that the code for determining the hole boundary can be: # Input: STL mesh model M # Output: Collection H of hole positions def build_hole_objects(M): V_unique = deduplicate_vertices(M.vertices) E_b = extract_boundary_edges(M.faces, V_unique) chains = build_closed_edge_chains(E_b) outer_chain = max(chains, key=lambda c: c.perimeter) H = [ ] for chain in chains: If chain is outer_chain: continue if chain.perimeter>LARGE_PERIMETER_THRESHOLD: continue if not chain.is_closed(): continue H.append(chain) return H Step S120: Perform contour analysis and circular arc fitting on the boundary of each hole to obtain the hole shape, geometric parameters, body center and normal vector of each hole.
[0016] In some embodiments, when determining the parameters of a standard part, what is actually needed later is not the original triangular facet, but rather the information such as which straight or curved segments the contour is composed of, whether they are closed, and the geometric relationships between the straight or curved segments. Therefore, it is necessary to perform contour analysis on the hole boundary to obtain this information, and then further perform arc fitting to determine the hole type, geometric parameters, body center, and normal vector of the hole.
[0017] See Figure 4 The specific processing method of step S120 above includes steps S1201-S1203, and the specific content is as follows: Step S1201: Perform contour analysis on the boundary of each hole to determine the curve segments and straight line segments in the boundary of each hole.
[0018] In some embodiments, curve segments and straight line segments refer to the contour segments in the hole location boundary that correspond to curved and straight line shapes, respectively, and are the basic components of the hole location contour. During contour analysis, it is necessary to decompose the hole location boundary into contour segments to identify which curve segments and which straight line segments are included.
[0019] Step S1202: When there is a curve segment in the boundary of any hole position, use the least squares method to perform circular arc fitting on each curve segment to obtain the circular arc segment corresponding to each curve segment.
[0020] In some embodiments, the least squares method is a classic algorithm for circular arc fitting, capable of fitting optimal circular arc parameters. The circular arc segment refers to the fitted standard circular arc, including parameters such as the center and radius. During contour analysis and circular arc fitting, various length thresholds, collinearity tolerances, and merging tolerances can be used to organize discrete boundary points into a stable contour segment structure, thereby avoiding the influence of short segments, noisy segments, and erroneous splitting caused by STL model discretization on subsequent hole shape judgment.
[0021] Step S1203: Determine the hole type, geometric parameters, body center, and normal vector of any hole position based on the straight line segment and circular arc segment of the hole position boundary.
[0022] In some embodiments, the body center here is not simply a mathematical geometric center, but rather a unified hole reference point used when determining the positional parameters in the standard part parameters. The normal vector of each hole represents the machining direction of that hole.
[0023] In one possible implementation, before step S120, the method further includes: determining the coplanarity of the hole positions boundary for each hole position; when the hole positions boundary of any hole position is not coplanar, determining the dominant plane of the hole position boundary and projecting the hole position boundary onto the dominant plane; and determining the hole position boundary in the dominant plane as the hole position boundary of any hole position.
[0024] In some embodiments, after obtaining the hole boundary of each hole, it is also necessary to interpret the structural meaning of the hole boundary, that is, to determine whether the hole boundary is coplanar. If the hole boundary of a hole is coplanar, subsequent contour analysis is performed directly along its fitted plane. If the hole boundary of a hole is not completely coplanar, the dominant plane of the hole boundary is found, and the hole boundary is projected onto the dominant plane. The projection of the hole boundary in the dominant plane is then determined as the hole boundary of this hole, so that it can still form a stable contour. This transforms the topological boundary into an understandable geometric contour. For the stamping process of the hole, the information needed during stamping is not the original triangular facet, but rather information such as which straight or curved segments the contour consists of, whether they are closed, and their geometric relationships. Ensuring that the hole boundary of each hole is on the same plane is essential for the hole object to proceed to hole type determination and selection parameter extraction.
[0025] It should be noted that when determining coplanarity, a plane must first be found mathematically such that the sum of the squares of the perpendicular distances from all grid vertices corresponding to the unique edge to this plane is minimized. This plane is the dominant plane of the hole location boundary. The perpendicular distance from each grid vertex corresponding to the unique edge to this plane is calculated. If all perpendicular distances are less than or equal to a preset threshold, the hole location boundary can be determined to be coplanar. If any perpendicular distance exceeds the preset threshold, these points and each unique edge need to be projected onto the dominant plane. The preset threshold can be set manually, for example, to 1×102. -6 mm.
[0026] In one possible implementation, step S1203 is specifically processed as follows: The hole type of any hole is determined based on the combination relationship between the straight line segments and circular arc segments of the hole position boundary; based on the hole type of any hole, corresponding geometric parameters are extracted from the hole position boundary; if there are circular arc segments in the hole position boundary, the average coordinates of the centers of all circular arc segments in any hole are determined as the coordinates of the body center of any hole, and the average local normal vectors of all circular arc segments are determined as the initial normal vector of any hole; if there are no circular arc segments in the hole position boundary, the centroid of the hole position boundary is determined as the body center of any hole, and the plane normal vector of the hole position boundary is determined as the initial normal vector of any hole; the initial normal vector of any hole is corrected to obtain the normal vector of any hole.
[0027] In some embodiments, hole type refers to the shape of the hole, and the geometric parameters include the radius of the arc, the center of the circle, the local normal vector, and also the length and direction of the line segment.
[0028] It should be noted that when a circular arc segment exists within the boundary of a hole location, see [reference needed]. Figure 5 ,like Figure 5 As shown, the coordinates of the center of each arc segment are averaged to obtain the coordinates of the body center of the hole. The local normal vector of each arc segment of the hole is averaged, and this average is determined as the initial normal vector of the hole. The initial normal vector needs to be corrected to obtain the final normal vector of the hole. When there is no arc segment in the boundary of a hole, the centroid of the hole boundary is determined as the body center of the hole, and the plane normal vector of the hole boundary is determined as the initial normal vector of the hole. After correcting the initial normal vector, the final normal vector of the hole is obtained. The z-axis component of the hole's normal vector should be negative, representing the downward machining direction.
[0029] In one possible implementation, the specific processing method for "correcting the initial normal vector of any hole position to obtain the normal vector of any hole position" is as follows: calculate the angle between the initial normal vector of any hole position and the direction vector of the positive stamping direction, and compare the angle with a preset angle threshold; if the angle is less than or equal to the preset angle threshold, then any hole position is determined as a positive stamping hole position, and the direction vector of the positive stamping direction is determined as the normal vector of any hole position; if the angle is greater than the preset angle threshold, then any hole position is determined as a side stamping hole position, and the normal vector of any hole position is determined according to multiple preset side stamping standard angles and the initial normal vector of any hole position.
[0030] In some embodiments, after obtaining the initial normal vector, it is necessary to adjust the initial normal vector in conjunction with the manufacturing direction. The positive stamping direction refers to the vertically downward processing direction, and its direction vector can be represented by [0, 0, -1]. The angle between the initial normal vector of a hole and the positive stamping direction refers to the angle between the initial normal vector of this hole and the negative direction of the z-axis. To ensure the accuracy of the angle between the initial normal vector and the positive stamping direction, the z-axis value in the initial normal vector of each hole needs to be less than 0. When the angle between the initial normal vector of a hole and the vector of the positive stamping direction is less than a preset angle threshold, it indicates that this hole is obtained by punching a standard punched part in the positive stamping direction. In this case, the positive stamping direction needs to be determined as the normal vector of this hole, such as... Figure 6 As shown, Figure 6 The process allowable threshold is a preset angle threshold, and the geometric normal is the initial normal vector. When the angle between the initial normal vector of a hole and the positive stamping direction is greater than the preset angle threshold, it indicates that this hole is obtained by punching a standard punch part in a specific side stamping direction. In this case, it is necessary to determine the normal vector of this hole based on multiple preset side stamping standard angles and the initial normal vector of this hole. The formula for calculating the angle between the initial normal vector and the positive stamping direction is:
[0031] in, Angle This is the initial normal vector for the hole position.
[0032] It should be noted that the preset angle threshold is not an arbitrary value. When determining the preset angle threshold, engineers need to set it based on the scanning error and normal fitting error of the STL model; typically, it can be set to 3°. By using the preset angle threshold, even with a slight deviation between the initial normal vector and the punching direction, the hole position is preferentially locked to the standard punching direction, avoiding the introduction of unnecessary wedge mechanisms due to identification errors. When the deviation exceeds the preset angle threshold, the standard side punching angle matching logic is then entered.
[0033] It should be noted that the code to correct the initial normal vector to a normal vector can be: # Input: Initial normal vector n of the hole position # Output: The normal vector n_out of the hole position def rectify_direction(n): axis = get_main_axis(n) theta = calc_angle(n, [0, 0, -1]) if theta<= DEVIATION_THRESHOLD: n_out = [0, 0, -1] direction_type = "normal_punch" else: n_out = normalize(n) direction_type = "side_punch" return n_out, direction_type In one possible implementation, the specific processing method for "determining the normal vector of any hole position based on multiple preset side stamping standard angles and the initial normal vector of any hole position" is as follows: calculate the angle difference between the included angle of any hole position and each side stamping standard angle; adjust the included angle of any hole position to the side stamping angle corresponding to the minimum value among the angle differences to obtain the normal vector of any hole position.
[0034] In some embodiments, since the standard wedge mechanism used for side punching only provides discrete angles, the initial normal vector of the side punching hole needs to be adjusted to meet manufacturing process requirements. The standard side punching angle refers to the angle provided by the standard wedge mechanism used for side punching. The standard wedge mechanism is a commercially available standard part, and different standard wedge mechanisms can provide different fixed standard side punching angles. See also Figure 7 After determining the normal vector for each hole, since there may be multiple side-punch holes in the STL model, each side-punch hole can be numbered (for example, by determining the number of each side-punch hole according to the hole identification order). The sequence number of each side-punch hole and its corresponding side-punch angle are then compiled into a side-punch angle configuration table. This table is displayed on the interactive interface for engineers to confirm, modify, and lock. This configuration table is used to convert continuous geometric calculation results into discrete process inputs that meet the selection requirements of standard parts, providing a basis for subsequent side-punch component modeling and assembly.
[0035] Step S130: Based on the hole type and geometric parameters of each hole, determine the unified selection inlet parameters for each hole.
[0036] In some embodiments, this solution does not allow different hole types to enter separate template databases, but instead extracts unified selection input parameters through hole type-specific rules. This ensures that different hole types ultimately enter the same standard part selection logic. The role of unified selection entry parameters is not just to provide a dimension value, but more importantly, to converge hole objects with different geometries into a single data entry that can be recognized by the standard part database.
[0037] In one possible implementation, step S130 is specifically processed as follows: each hole is identified by its hole type; based on the identified different hole types, a unified selection entry parameter is extracted from the geometric parameters corresponding to each hole according to the preset rules corresponding to different hole types, so that holes of different hole types enter the same standard part selection logic in the form of unified parameters.
[0038] In some embodiments, the hole type categories include round holes, rectangular holes, oblong holes, rounded rectangular holes, etc. See also Figure 8 When the hole type of a certain hole position is a round hole, the unified selection entry parameter for this hole position is the diameter of the round hole; when the hole type of a certain hole position is a rectangular hole, the unified selection entry parameter for this hole position is the length of the long side of the rectangular hole; when the hole type of a certain hole position is an oblong hole, the unified selection entry parameter for this hole position is the sum of the length of the straight segment of the oblong hole and the diameter of the arc; when the hole type of a certain hole position is a rounded rectangular hole, the unified selection entry parameter for this hole position is the sum of the length of the long straight side of the rounded rectangular hole and the diameter of the rounded corner.
[0039] For a circular hole, if the fitted radius of the circular hole is... The unified selection input parameters are:
[0040] For a rectangular hole, if the length of the longer side of the rectangular hole is... The unified selection input parameters are:
[0041] For an oblong hole, if the length of the straight segment of the oblong hole is... The radius of the arc is The unified selection input parameters are:
[0042] For a rounded rectangular hole, if the length of the longer straight side of the rounded rectangular hole is... The radius of the fillet is The unified selection input parameters are:
[0043] Although round holes, rectangular holes, oblong holes, and rounded rectangular holes have completely different outlines, the geometric parameters of these holes can be standardized into unified selection inlet parameters through hole-type specific rules. .therefore, It is not a regular dimension description value, but a key intermediate value that converges different hole objects to the same standard part selection logic.
[0044] It should be noted that the extraction of unified selection input parameters can be achieved through the following code: # Input: Hole location object type T, profile geometry parameter geo # Output: Unified selection input parameter P def extract_unified_parameter(T, geo): if T == "circle": P = geo["diameter"] elif T == "rectangle": P = geo["long_edge"] elif T == "slot": P = geo["straight_length"] + geo["arc_diameter"] elif T == "rounded_rectangle": P = geo["long_edge"] + geo["corner_diameter"] else: raise ValueError("unsupported hole type") return P Step S140: Determine the standard part parameters of the punching standard part for each hole position based on the unified selection inlet parameters, body center, normal vector and standard part library for each hole position.
[0045] It should be noted that after obtaining the unified selection entry parameters for each hole position, the hole position number, hole position boundary, hole position body center, normal vector, hole type, unified selection entry, and standard part parameters of the punching standard part can be constructed into a continuously transferable dedicated semantic feature set. This dedicated semantic feature set can be directly used as a continuously transferable and repeatedly invoked engineering input to control the punching operation of the punching standard part. The expression is:
[0046] in, A unique number for each hole position. For the hole position boundary, For the body center of the hole position, Let be the normal vector of the hole position. According to the hole type category, To standardize the input parameters for model selection, These are the standard part parameters for punching standard parts, including the dimensions, lengths, and orientation angles required for the generation of punches, dies, and mounting bases.
[0047] In some embodiments, standard part parameters include punch parameters, die parameters, and mounting base parameters.
[0048] In one possible implementation, step S140 is specifically processed as follows: based on the unified selection entry parameters for any hole position, standard punch parts and standard die parts are selected from the standard parts library; based on the cutting depth of the standard punch part, the body center and normal vector of any hole position, the center position of the standard punch part is calculated, and the shape parameters, cutting depth, center position, body center and normal vector of the standard punch part are determined as the punch parameters for any hole position; the shape parameters, body center and normal vector of the standard die part corresponding to any hole position are determined as the die parameters for any hole position; based on the unified selection entry parameters for any hole position and the punch diameter of the standard punch part for any hole position, a standard fixed seat part is selected from the standard parts library, and the shape parameters, body center and normal vector of the standard fixed seat part are determined as the fixed seat parameters for any hole position.
[0049] In some embodiments, after obtaining the unified selection input parameters for each hole position, it is also necessary to send the unified selection input parameters into the standard parts database to obtain the parameters of the punch, die, and fixed seat. In this process, information such as normal vector, hole type, and body center from the dedicated semantic feature set is also required.
[0050] It should be noted that for the punch parameters, after matching the punch's H (punch height), D (punch diameter), B (punch fixed section), and L (punch total length) parameters from the standard parts library based on the unified selection entry parameters, it is also necessary to combine the hole's body center, normal vector, and punch penetration amount to generate the punch center position. The punch center position can be simplified as follows:
[0051] in, For the first h The center position of the punch corresponding to each hole; The body center of the hole; It is the normal vector; This is the total length of the punch; This refers to the depth of cut. In other words, after finding the punch model in the standard parts library, it is necessary to combine the unified selection entry parameters with the hole center, manufacturing direction (normal vector), and length parameters to convert them into spatial position and orientation results, and finally output a complete set of results: "Center-X / Y / Z (center coordinates) + Vector-X / Y / Z (normal vector) + standard parts dimension parameters".
[0052] For the die parameters, according to Query the die database with the selected die length to obtain... (Total length of the die) (outer diameter of the die) (Width of die cutting edge or working section) (The inner diameter of the die cavity needs to match the diameter of the punch.) Parameters such as (die flange or positioning table dimensions) are included, and the current hole center and manufacturing direction (normal vector) are also written into the die parameter results. The generation of the fixed seat parameters further depends on the punch diameter. Query the fixed seat database to get (Length of the fixed base) (Width of the mounting base) (Height of the fixed base) , , (Fixed bracket installation and positioning dimensions) (Fixed seat height) (Location of mounting bracket fastener or screw hole) (Fixed corners or transition dimensions of the mounting base) (Diameter of the large hole in the center of the fixing base) (Diameter of the mounting bracket screw hole) (Fixed seat wall thickness or step thickness) Parameters such as (diameter of auxiliary positioning hole of fixed seat) are then added to the attitude parameters of fixed seat.
[0053] It should be noted that standard part parameters can be generated using the following code: # Input: Semantic feature set S_h for hole location objects # Output: Punch, Mold sleeve, Fixed seat parameter results def generate_standard_parts(S_h): P = S_h["P_value"] center = S_h["center"] direction = S_h["direction"] punch = query_punch_database(P) die = query_die_database(P, selected_length=20) seat = query_fixed_seat_database(punch["D"]) punch_result = build_punch_result(center, direction, punch) die_result = build_die_result(center, direction, die) seat_result = build_seat_result(center, direction, seat) return { "Punch": punch_result, "MoldSleeve": die_result, "FixedSeat": seat_result } By filtering hole boundaries from the STL model, performing structured geometric interpretation on the hole boundaries, and correcting the normal vectors, a unified selection entry parameter is determined for different hole types. This allows for the automatic conversion from the original STL mesh to complete engineering parameters for the punch, die, and mounting base without relying on existing process models, predefined punching coordinate systems, or manually supplementing engineering information. Furthermore, the correction of the normal vectors effectively filters out geometric errors caused by STL scanning, mesh discretization, and contour fitting, avoiding misjudgments between front and side punches due to minor errors. The unified selection entry parameter simultaneously enables unified selection processing for different hole shapes such as round holes, rectangular holes, waist-shaped holes, and rounded rectangular holes. This significantly reduces the workload of manually identifying contours, determining punching directions, and consulting standard parts tables. It effectively improves the efficiency of punching standard parts processing while ensuring the accuracy of the final parameters, providing reliable support for the automated implementation of reverse engineering of stamping dies.
[0054] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0055] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0056] Figure 9 A schematic diagram of the punching standard part parameter generation device provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below: like Figure 9 As shown, the punching standard part parameter generation device 9 includes: Boundary determination module 91 is used to determine the hole boundary of each hole position based on the pre-acquired STL model; Analysis module 92 is used to perform contour analysis and arc fitting on the boundary of each hole position to obtain the hole shape, geometric parameters, body center and normal vector of each hole position; The parameter determination module 93 is used to determine the unified selection inlet parameters for each hole position based on the hole type and geometric parameters of each hole position. The generation module 94 is used to determine the standard part parameters of the punching standard part for each hole position based on the unified selection entry parameters, body center, normal vector and standard part library for each hole position.
[0057] In one possible implementation, the boundary determination module 91 is specifically used to: remove duplicate vertices from multiple meshes in the pre-acquired STL model, and select multiple unique edges from the connections between the multiple mesh vertices after vertex deduplication; link the multiple unique edges into multiple closed chains using adjacency tracing; determine the closed chain with the longest length as the outer contour of the part, and determine the remaining closed chains as candidate inner boundaries; and determine the candidate inner boundaries whose length does not exceed a preset length threshold as the hole boundary of each hole.
[0058] In one possible implementation, the analysis module 92 is specifically used to: perform contour analysis on the boundary of each hole position to determine the curve segments and straight line segments in the boundary of each hole position; when there is a curve segment in the boundary of any hole position, use the least squares method to perform arc fitting on each curve segment to obtain the arc segment corresponding to each curve segment; and determine the geometric parameters, body center, and normal vector of any hole position based on the straight line segments and arc segments of the boundary of any hole position.
[0059] In one possible implementation, the analysis module 92 is further configured to: determine the coplanarity of the hole position boundaries for each hole position; when the hole position boundaries of any hole position are not coplanar, determine the dominant plane of the hole position boundaries and project the hole position boundaries onto the dominant plane; and determine the hole position boundaries in the dominant plane as the hole position boundaries of any hole position.
[0060] In one possible implementation, the analysis module 92 is further configured to: determine the hole type of any hole position based on the combination relationship between the straight line segments and arc segments of the hole position boundary; extract the corresponding geometric parameters from the hole position boundary based on the hole type of any hole position; if there are arc segments in the hole position boundary of any hole position, determine the average coordinates of the center coordinates of all arc segments of any hole position as the coordinates of the body center of any hole position, and determine the average local normal vector of all arc segments as the initial normal vector of any hole position; if there are no arc segments in the hole position boundary of any hole position, determine the centroid of the hole position boundary of any hole position as the body center of any hole position, and determine the plane normal vector of the hole position boundary as the initial normal vector of any hole position; and correct the initial normal vector of any hole position to obtain the normal vector of any hole position.
[0061] In one possible implementation, the analysis module 92 is further configured to: calculate the angle between the initial normal vector of any hole position and the positive stamping direction, and compare the angle with a preset angle threshold; if the angle is less than or equal to the preset angle threshold, then any hole position is determined as a positive stamping hole position, and the vector corresponding to the positive stamping direction is determined as the normal vector of any hole position; if the angle is greater than the preset angle threshold, then any hole position is determined as a side stamping hole position, and the normal vector of any hole position is determined according to a plurality of preset side stamping standard angles and the initial normal vector of any hole position.
[0062] In one possible implementation, the analysis module 92 is further configured to: calculate the angle difference between the included angle of any hole position and each side stamping standard angle; adjust the included angle between the initial normal vector of any hole position and the z-axis to the side stamping angle corresponding to the minimum value among the angle differences, thereby obtaining the normal vector of any hole position.
[0063] In one possible implementation, the parameter determination module 93 is specifically used for: identifying the hole type category for each hole; based on the identified different hole types, extracting unified selection entry parameters from the geometric parameters corresponding to each hole according to the preset rules corresponding to different hole types, so that holes of different hole types enter the same standard part selection logic in the form of unified parameters.
[0064] In one possible implementation, the generation module 94 is specifically used for: selecting punch standard parts and die standard parts from the standard parts library based on the unified selection entry parameters of any hole position; calculating the center position of the punch standard part based on the cutting depth of the punch standard part, the body center and normal vector of any hole position, and determining the shape parameters, cutting depth, center position, body center and normal vector of the punch standard part as the punch parameters of any hole position; determining the shape parameters, body center and normal vector of the die standard part of any hole position as the die parameters of any hole position; selecting fixed seat standard parts from the standard parts library based on the unified selection entry parameters of any hole position and the punch diameter of the punch standard part of any hole position, and determining the shape parameters, body center and normal vector of the fixed seat standard part as the fixed seat parameters of any hole position.
[0065] Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Figure 10 As shown, the electronic device 10 of this embodiment includes a processor 101 and a memory 102. The memory 102 stores a computer program 103. When the processor 101 executes the computer program 103, it implements the steps in the various method embodiments described above. Alternatively, when the processor 101 executes the computer program 103, it implements the functions of each module / unit in the various device embodiments described above.
[0066] For example, computer program 103 may be divided into one or more modules / units, which are stored in memory 102 and executed by processor 101 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 103 in electronic device 10.
[0067] Electronic device 10 may include, but is not limited to, processor 101 and memory 102. Those skilled in the art will understand that... Figure 10 This is merely an example of electronic device 10 and does not constitute a limitation on electronic device 10. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 10 may also include input / output devices, network access devices, buses, etc.
[0068] Processor 101 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0069] The memory 102 can be an internal storage unit of the electronic device 10, such as a hard disk or RAM of the electronic device 10. The memory 102 can also be an external storage device of the electronic device 10, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 10. Furthermore, the memory 102 can include both internal and external storage units of the electronic device 10. The memory 102 is used to store the computer program 103 and other programs and data required by the electronic device 10. The memory 102 can also be used to temporarily store data that has been output or will be output.
[0070] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.
[0071] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.
[0072] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating parameters for punched standard parts, characterized in that, include: Based on the pre-acquired STL model, the hole boundary of each hole is determined; Contour analysis and circular arc fitting are performed on the boundary of each hole to obtain the hole shape, geometric parameters, body center and normal vector of each hole. Based on the hole type and geometric parameters of each hole, determine the unified selection inlet parameters for each hole. Based on the unified selection of inlet parameters, body center, normal vector, and standard parts library for each hole, determine the standard parts parameters of the punching standard parts for each hole.
2. The method for generating parameters for punched standard parts according to claim 1, characterized in that, The process of determining the hole location boundary for each hole location based on a pre-acquired STL model includes: The grid vertices of multiple grids in the pre-acquired STL model are deduplicated, and multiple unique edges are selected from the connections between the multiple grid vertices after deduplication. The multiple unique edges are linked into multiple closed chains using adjacency tracing. The longest closed chain is defined as the outer contour of the part, and the remaining closed chains are defined as candidate inner boundaries; Candidate inner boundaries whose length does not exceed a preset length threshold are determined as the hole boundaries for each hole.
3. The method for generating parameters for punched standard parts according to claim 1, characterized in that, The process of performing contour analysis and circular arc fitting on the boundary of each hole position to obtain the hole shape, geometric parameters, body center, and normal vector of each hole position includes: Perform contour analysis on the boundary of each hole to determine the curve segments and straight line segments in the boundary of each hole. When there is a curve segment in the boundary of any hole position, the least squares method is used to fit the arc to each curve segment to obtain the arc segment corresponding to each curve segment. Based on the straight line segment and circular arc segment of the hole position boundary of any hole position, determine the hole type, geometric parameters, body center, and normal vector of any hole position.
4. The method for generating parameters for punched standard parts according to claim 3, characterized in that, Before performing contour analysis on the boundary of each hole location to determine the curve and straight line segments within that boundary, the following steps are also included: Perform coplanarity checks on the boundaries of each hole location; When the boundaries of any hole position are not coplanar, determine the dominant plane of the hole position boundary and project the hole position boundary onto the dominant plane; The hole boundary in the dominant plane is defined as the hole boundary of any hole.
5. The method for generating parameters for punched standard parts according to claim 3, characterized in that, The step of determining the hole type, geometric parameters, body center, and normal vector of any hole position based on the straight line segment and circular arc segment of the hole position boundary includes: The hole type of any hole is determined based on the combination relationship between the straight line segment and the circular arc segment of the hole boundary of any hole position. Based on the hole shape of any hole position, extract the corresponding geometric parameters from the hole position boundary; If there is an arc segment in the boundary of any hole position, the average value of the coordinates of the center of all arc segments of any hole position is determined as the coordinates of the body center of any hole position, and the average value of the local normal vectors of all arc segments is determined as the initial normal vector of any hole position. If there is no arc segment in the boundary of any hole position, then the centroid of the boundary of any hole position is determined as the body center of any hole position, and the plane normal vector of the boundary of the hole position is determined as the initial normal vector of any hole position. The initial normal vector of any hole position is corrected to obtain the normal vector of any hole position.
6. The method for generating parameters for punched standard parts according to claim 5, characterized in that, The step of correcting the initial normal vector of any hole position to obtain the normal vector of any hole position includes: Calculate the angle between the initial normal vector of any hole and the direction vector of the positive stamping direction, and compare the angle with a preset angle threshold. If the included angle is less than or equal to the preset angle threshold, then any hole position is determined as a positive stamping hole position, and the direction vector of the positive stamping direction is determined as the normal vector of any hole position; If the included angle is greater than the preset angle threshold, then any hole position is determined as a side-punching hole position, and the normal vector of any hole position is determined according to the preset multiple side-punching standard angles and the initial normal vector of any hole position.
7. The method for generating parameters for punched standard parts according to claim 6, characterized in that, Based on multiple preset side stamping standard angles and the initial normal vector of any hole position, the normal vector of any hole position is determined, including: Calculate the angle difference between the included angle of any hole and the standard angle of each side stamping; The included angle of any hole is adjusted to the side punching angle corresponding to the minimum value among the angle differences, and the normal vector of any hole is obtained.
8. The method for generating parameters for punched standard parts according to claim 1, characterized in that, The determination of unified selection inlet parameters for each hole position based on the hole type and geometric parameters includes: Hole type classification is identified for each hole location; Based on the identified different hole types, and according to the preset rules corresponding to different hole types, a unified selection entry parameter is extracted from the geometric parameters corresponding to each hole position, so that holes of different hole types can enter the same standard part selection logic in the form of unified parameters.
9. The method for generating parameters for punched standard parts according to claim 1, characterized in that, The standard part parameters include punch parameters, die parameters, and mounting base parameters; The standard part parameters for determining the punching standard part for each hole position are as follows, based on the unified selection of inlet parameters, body center, normal vector, and standard part library: Based on the unified selection inlet parameters for any hole position, standard punch parts and standard die parts are selected from the standard parts library; Based on the cutting depth of the punch standard part, the body center and normal vector of any hole position, calculate the center position of the punch standard part, and determine the morphological parameters of the punch standard part, the cutting depth, the center position, the body center and normal vector of any hole position as the punch parameters of any hole position. The shape parameters of the die standard part corresponding to any hole, the body center and the normal vector of any hole are determined as the die parameters of any hole. Based on the unified selection inlet parameters of any hole position and the punch diameter of the punch standard part of the hole position, the fixed seat standard part is selected from the standard part library, and the shape parameters of the fixed seat standard part, the body center and normal vector of the hole position are determined as the fixed seat parameters of the hole position.
10. A device for generating parameters for punched standard parts, characterized in that, include: The boundary determination module is used to determine the hole boundary of each hole position based on the pre-acquired STL model; The analysis module is used to perform contour analysis and arc fitting on the boundary of each hole position to obtain the hole shape, geometric parameters, body center and normal vector of each hole position; The parameter determination module is used to determine the unified selection inlet parameters for each hole position based on the hole type and geometric parameters of each hole position. The generation module is used to determine the standard part parameters of the punching standard part for each hole position based on the unified selection entry parameters, body center, normal vector and standard part library for each hole position.