A template map generation method
Patent Information
- Application Number
- CN202610923366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-06-25
AI Technical Summary
[0005]为解决上述问题,本发明提供一种自动化、高精度且一致性好的样板图生成方法,旨在克服现有技术效率低下、依赖人工的缺陷
本发明提出了一种对钣金零件实现自动展开与标注的方法。该方法主要基于三维钣金零件中基准面与法兰面的交线,结合投影变换与斜角值采样,对带变斜角弯边的钣金零件实现自动展开与斜角信息标注。本发明适用于对三维钣金零件,尤其是带变斜角弯边零件的快速、精确展开,能够自动化生成包含关键斜角标注的二维样板图,极大地提升了工艺设计的效率与质量。
Smart Images

Figure CN122471630B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer-aided design technology, specifically relating to a method for generating template diagrams. Background Technology
[0002] In fields such as mechanical design, sheet metal processing, and mold manufacturing, template drawings are key technical documents guiding process design, CNC programming, and quality inspection. Their core function is to accurately express the geometric relationships between adjacent surfaces of a part, especially the included angles, bending parameters, and unfolded contours at bends. Traditional template drawing generation heavily relies on manual experience; designers must manually draw two-dimensional unfolded diagrams in CAD systems, annotating parameters such as bending angles, inner radii, and bend heights, resulting in low efficiency and a high risk of errors.
[0003] To improve automation levels, existing technologies have proposed several solutions. For example, a patent document titled "An Automated Template Generation Method and System Based on UG Software" proposes an automated template generation method and system. This method achieves automation by constructing a complex process rule library and employing parameter-rule dynamic mapping, real-time conflict detection, and correction mechanisms. However, such methods heavily rely on predefined, large process rule libraries and real-time verification mechanisms, resulting in high system computational overhead and response speed limited by the complexity of the rule library and real-time inference performance. For many specific application scenarios that only require quickly and accurately extracting geometric relationships from 3D models and generating unfolded template diagrams, this introduces unnecessary computational resources and implementation complexity.
[0004] Therefore, a lightweight, geometry-driven template generation method is needed that does not require complex rule binding and closed-loop correction. It should be able to directly and accurately express the spatial relationship and process angle between adjacent surfaces through efficient geometric calculations based on the three-dimensional geometric model of the part, so as to meet the efficiency and accuracy requirements of engineering drawing. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides an automated, highly accurate, and consistent template generation method, aiming to overcome the shortcomings of existing technologies, such as low efficiency and reliance on manual labor.
[0006] The present invention is achieved through the following technical solution.
[0007] A method for generating template diagrams includes the following steps: Step S1: Read in the target part file to obtain the target part; Step S2: Obtain the specified datum plane in the 3D model of the target part, and take a datum plane reference point on the datum plane; measure the distance from the datum plane reference point along the normal of the datum plane to another surface of the target part to obtain the thickness of the target part; Step S3: Perform adjacent surface detection on the reference surface to obtain a list of grouped bend surfaces; traverse each group of bend surfaces in the list of grouped bend surfaces, extract the bending angle and add it to the bending angle list, and extract the inner bending radius and add it to the inner bending radius list. Step S4: Perform adjacent flange face detection on the grouped flange face list to obtain the grouped flange face list; extract the flange height of each group of flange faces in the grouped flange face list to obtain the flange height list. Step S5: Perform an extension surface intersection operation on the grouped flange surface list and the reference surface to obtain the first intersection line list; Step S6: Based on the first intersection line list, the grouped flange face list, and the reference plane, obtain the grouped bend angle value list through the angle value acquisition operation; Step S7: Based on the reference plane, create a two-dimensional engineering drawing; using the reference plane as the projection plane, orthogonally project each intersection line in the first intersection line list onto the two-dimensional engineering drawing to obtain the intersection line projection; construct the first intersection line projection list based on the intersection line projection; perform the oblique angle value marking operation in the two-dimensional engineering drawing according to the grouped bend angle value list and the first intersection line projection list; Step S8: Based on the target part's thickness, bending angle list, bending inner radius list, and bend height list, obtain the unfolded value list through unfolded value calculation operation; based on the unfolded value list and the first intersection line projection list, generate the template unfolded drawing through intersection line projection unfolding operation.
[0008] Furthermore, the process of obtaining the grouped bending surface list in step S3 includes: adding all surfaces adjacent to the outer edge of the reference surface to the candidate bending surface list; filtering out candidate surfaces in the candidate bending surface list that are tangentially continuous with the reference surface to construct the bending surface list; and merging the bending surfaces in the bending surface list that are spatially adjacent to each other through edges into the same group to obtain a grouped bending surface list composed of multiple bending surface groups.
[0009] Furthermore, the operation of extracting the bending angle and inner bending radius in step S3 specifically includes: for the bending surface group in the grouped bending surface list, identifying whether the outer edge of the first bending surface in the bending surface group is an arc; when the outer edge is identified as an arc, obtaining the central angle corresponding to the arc segment from the arc start point along the arc path to the arc end point, and adding the central angle as the bending angle to the bending angle list; at the same time, obtaining the arc radius, subtracting the thickness of the target part from the arc radius to obtain the inner radius, and adding the inner radius to the inner bending radius list.
[0010] Furthermore, the operation of obtaining the grouped flange face list in step S4 includes: filtering out all the outer adjacent faces of each bend face in each group of bend faces in the grouped bend face list; identifying adjacent faces that are tangentially continuous with the bend faces in the grouped bend face list, are not the reference faces, and are not included in the bend face list as flange faces; and forming a flange face group by the set of flange faces belonging to the same group of bend faces. All flange face groups constitute the grouped flange face list.
[0011] Furthermore, the process of extracting the bend height in step S4 includes: for each flange face group in the grouped flange face list, determining the common edge of the flange face in the flange face group and the bend face in the corresponding bend face group as the reference edge, calculating the minimum Euclidean distance from all outer edges of the flange face in the flange face group to the reference edge, obtaining a set of distance values, taking the maximum value in this set of distance values as the bend height of the flange face group, and adding it to the bend height list.
[0012] Furthermore, the operation of obtaining the first intersection list in step S5 specifically includes: for each flange group in the grouped flange face list, finding the common edge between the corresponding bend face groups of the flange face group, these common edges constitute the first common edge list, extending the flange face group in the direction of the first common edge list to obtain an extended surface; calculating the intersection line between the extended surface and the plane where the reference surface is located, defining the intersection line as the first intersection line, and adding the first intersection line to the first intersection line list.
[0013] Furthermore, step S6, which involves obtaining the list of grouped bend angle values through the angle value acquisition operation, includes: Get the number of sampling points preset by the user; Calculate the length of each first intersection line in the first intersection line list, and calculate the first sampling distance: ; Among them, D sp1 N represents the first sampling distance, Len1 represents the length of the first intersection line in the first intersection line list, and N represents the first sampling distance. sp This indicates the number of sampling points input by the user on the human-computer interaction interface. Sampling points are obtained by sampling at equal intervals along the length direction of the first intersection line with the first sampling distance as the interval. A normal plane that passes through the sampling points and is perpendicular to the intersection line is constructed, and all normal planes are stored in the normal plane list. Calculate the intersection line of each normal plane in the normal plane list with the datum plane as the second intersection line, and calculate the intersection line of each normal plane in the normal plane list with the flange face corresponding to the first intersection line as the third intersection line; if the third intersection line is a space curve, then use the straight line segment connecting its first and last endpoints to represent it. Calculate the angle between the second and third intersection lines and use the angle as the slope value at the sampling point. After traversing all sampling points on a first intersection line, group these slope values together and add them to the list of grouped bend slope values.
[0014] Furthermore, the specific process of marking the oblique angle value on the two-dimensional engineering drawing D in step S7 includes: Calculate the second sampling distance D sp2 and the third sampling distance D sp3 : ; ; Where Len2 represents the length of the first intersection projection list, N sp This indicates the number of sampling points entered by the user on the human-computer interaction interface. This refers to the number of the angled value in the angled value group within the list of grouped bend angled values; Take a point at a distance from the third sampling distance on the intersection projection of the first intersection projection list as an auxiliary annotation point; create a short line perpendicular to the intersection projection at this annotation point as a leader line; subtract 90 degrees from the bevel angle value to obtain the bevel angle value used for engineering annotation, and automatically generate a text annotation next to the leader line, which is the calculated bevel angle value.
[0015] Furthermore, in step S8, based on the target part's thickness, bending angle list, bending inner radius list, and bend height list, the specific process of obtaining the unfolded value list through unfolded value calculation is as follows: Calculate the first expanded value using the following formula: ; in, The first expansion value, For the i-th bend in the list of inner radii n One inner radius value, For the i-th bend angle in the list n One bending angle value, For the i-th bend height in the list n The bending height value, K, is a coefficient obtained from the bending coefficient table based on the target part material. Let π be the thickness of the target part and π be the circumference ratio; add the first unfolded value to the unfolded value list.
[0016] Furthermore, the specific process of generating the template unfolded drawing in step S8 by unfolding the intersection projection according to the unfolded value list and the first intersection projection list includes: offsetting each intersection projection in the first intersection projection list along the outer normal direction in the two-dimensional engineering drawing D, with the offset amount being the unfolded value corresponding to the intersection projection in the unfolded value list, so as to generate the template drawing.
[0017] The beneficial effects of this invention are: This invention proposes a method for automatically unfolding and annotating sheet metal parts. This method is primarily based on the intersection of the reference plane and the flange surface in a 3D sheet metal part, combined with projection transformation and oblique angle value sampling, to automatically unfold and annotate oblique angle information for sheet metal parts with variable oblique angle bends. This invention is applicable to the rapid and accurate unfolding of 3D sheet metal parts, especially those with variable oblique angle bends, and can automatically generate 2D template drawings containing key oblique angle annotations, greatly improving the efficiency and quality of process design. Attached Figure Description
[0018] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0019] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0020] like Figure 1 As shown, a method for generating a template image includes the following steps: Step S1: Read in the target part file to obtain the target part C; Step S2: Obtain the specified datum plane P in the 3D model of the target part C. base and the thickness T of the target part C c ; Step S3: For the reference plane P base Perform adjacent surface detection to obtain a grouped list of curved surfaces PG. bend ; Traverse the grouped curved surface list PG bend For each set of curved surfaces, extract the bending angle and add it to the bending angle list L. a1 In the middle, extract the inner radius of the bend and add it to the inner radius of the bend list L. r1 middle; Step S4: List the grouped bend surfaces PG bend Perform adjacent flange face detection to obtain a grouped flange face list PG. flange ; List of grouped flange faces PG flange The bending height is extracted from each group of flange faces to obtain a bending height list L. h1 ; Step S: List the grouped flange faces PG flange With reference plane P base Perform the surface extension intersection operation to obtain the first intersection line list L. i1 ; Step S6: According to the first intersection line list L i1 Grouped flange face list PG flange and reference plane P baseThe diagonal angle value acquisition operation yields a list of grouped bend angle values LG. a ; Step S7: Based on datum plane P base Create a 2D engineering drawing D; with reference plane P base As the projection plane, list the first intersection lines L i1 Each intersection line in the diagram is orthogonally projected onto the two-dimensional engineering drawing D to obtain the intersection line projection; the first intersection line projection list L is constructed based on the intersection line projections. ip1 According to the list of grouped bend angle values LG a Projection list L of the first intersection line ip1 In the 2D engineering drawing D, mark the oblique angle value; Step S8: Based on the thickness T of the target part C c List of bending angles L a1 List of inner bending radii L r1 and the list of bend heights L h1 The expanded value list L is obtained through the expanded value calculation operation. flat According to the expanded value list L flat Projection list L of the first intersection line ip1 The template unfolded diagram is generated by projecting the intersection lines.
[0021] In step S2, the thickness T of the target part C is obtained. c The specific steps are as follows: Step S21: The user selects a plane on the 3D model of the target part C through the human-computer interaction interface, and defines the plane as the reference plane P. base ; on datum plane P base Take a reference point Pt on the datum plane. br ; Step S22, measure the reference point Pt on the datum plane. br The thickness T of the target part is obtained by measuring the distance from the reference plane along the normal direction to the other surface of the target part C. c .
[0022] In step S3, the reference plane P is... base Perform adjacent surface detection to obtain a grouped list of curved surfaces PG. bend The specific steps are as follows: Step S31, let L bend This represents a list of bent surfaces, where L represents the list of bent surfaces. bend Initialize to empty; let LC bend This represents the list of candidate bend surfaces, LC. bend Initialize to empty; Step S32, compare with the reference plane P base All faces adjacent to the outer edge are added to the candidate bend face list LCbend middle; Step S33, set the first loop variable i a , set the first loop variable i a The initial value is set to 1, let LC bend,ia LC represents the list of candidate bend surfaces bend The i-th a One candidate face; Step S331, if the first loop variable i a >N1, skip to step S334, where N1 represents the candidate bend surface list LC bend The number of candidate bend surfaces in the data; Step S332, if the reference plane P base With the candidate bend surface list LC bend The i-th a Candidate face LC bend,ia It is tangent continuous, and the candidate bend surface list LC is used. bend The i-th a Candidate face LC bend,ia Add to the list of curved surfaces L bend ; Step S333, change the first loop variable i a Increment the value by 1, then jump to step S331; Step S334, end the current step; Step S34, list L of the curved surface bend Grouping yields a list of grouped bend surfaces PG. bend The specific steps are as follows: Step S341, let the grouped bend surface list PG bend Initialize to empty; let L bdpd This represents the list of processed bend surfaces; the list L contains the processed bend surfaces. bdpd Initialize to empty; let L bend1 This represents the list of the first curved surfaces, L. bend1 Initialize to empty; let Q bend1 This represents the diffusion queue at the first bend surface, and Q represents the diffusion queue at the first bend surface. bend1 Initialize to empty; set the first queue face Pi. qbd1 Set the first adjacent face list LPn1, and initialize the first adjacent face list LPn1 to empty; Step S342, set the second loop variable i b , the second loop variable i b The initial value of L is set to 1. bend,ib List of curved surfaces L bend The i-th b One candidate face; Step S3421, if the second loop variable i b If N2 is greater than or equal to N2, then proceed to step S3428, where N2 represents the list of bent surfaces L. bend The number of curved surfaces in the middle; Step S3422, if the curved surface list L bend The i-th b Candidate face L bend,ib Already exists in the processed face list L bdpd If the condition is met, proceed to step S3427; Step S3423, list the first curved surface L bend1 Clear; expand the first bend edge diffusion queue Q. bend1 Clear; Step S3424, list the curved surfaces L bend The i-th b Candidate face L bend,ib Add to the first curved edge list L bend1 In the middle, list the curved surfaces L bend The i-th b Candidate face L bend,ib Add to the first bend edge diffusion queue Q bend1 The tail of the line; Step S34241, if the first bend surface diffusion queue Q bend1 If empty, jump to S3425; Step S34242, diffuse queue Q from the first bend face bend1 Take a face from the head of the queue and assign it to face Pi in the first queue. qbd1 ; Step S34243, if the first queue face Pi qbd1 In the list of processed bend surfaces L bdpd If the condition is met, proceed to step S34241; Step S34244, move the first queue face Pi qbd1 All adjacent faces are added to the first adjacent face list LPn1; Step S34245, set the third loop variable i c The third loop variable i c The initial value is set to 1, let LPn 1,ic Represents the i-th face in the first adjacent face list LPn1 c Adjacent faces; Step S342451, if the third loop variable i c If N3 is greater than N3, then proceed to step S34246, where N3 represents the number of adjacent faces in the first adjacent face list LPn1; Step S342452, if the i-th face in the first adjacent face list LPn1c Adjacent faces LPn 1,ic In the list of curved surfaces L bend In the first adjacent face list LPn1, the i-th face... c Adjacent faces LPn 1,ic Add to the first curved edge list L bend1 In the first adjacent face list LPn1, the i-th face... c Adjacent faces LPn 1,ic Add to the first bend edge diffusion queue Q bend1 The tail of the line; Step S342453, change the third loop variable i c The value is increased by 1, and the process jumps to step S342451; Step S34246, move the first queue face Pi qbd1 Add to the list of processed bend surfaces L bdpd middle; Step S34247, skip to step S34241; Step S3425: End the current step; Step S3426, list the first curved surface L bend1 Add to the grouped bend surface list PG bend middle; Step S3427, change the second loop variable i b Increment the value by 1, then jump to step S3421; Step S3428, end the current step; In step S3, the grouped bend surface list PG is traversed. bend For each set of curved surfaces, extract the bending angle and add it to the bending angle list L. a1 In the middle, extract the inner radius of the bend and add it to the inner radius of the bend list L. r1 The specific steps are as follows: Step S35, let PB g1 This indicates the first curved face in the currently traversed curved face group; Step S36, let LEg pbg1 This represents the first outermost list, LEg. pbg1 Initialize to empty; set the first bend face PB in the currently traversed bend face group to empty. g1 All outer edges are added to the first outer edge list LEg pbg1 In the middle; set the fourth loop variable i d The fourth loop variable i d Set the initial value of LEg to 1. pbg1,id Represents the first outermost list LEg pbg1 The i-th d The outer edge of the strip.
[0023] Step S361, if the fourth loop variable i d If N4 is greater than N4, then proceed to step S37, where N4 represents the first outermost list LEg. pbg1 The number of edges in the middle; Step S362, if the first outermost list LEg pbg1 The i-th d outer edge LEg pbg1,id If it is not an arc, skip to step S366.
[0024] Step S363, according to the first outer edge list LEg pbg1 The i-th d outer edge LEg pbg1,id For the corresponding arc, obtain the central angle of the arc segment from the starting point to the ending point along the arc path, and add the central angle to the bending angle list L. a1 middle; Step S364, according to the first outer edge list LEg pbg1 The i-th d outer edge LEg pbg1,id For the corresponding arc, obtain the arc radius, and subtract the thickness T of the target part C from this radius. c After obtaining the inner radius, add the inner radius to the bending inner radius list L. r1 middle; Step S365, skip to step S37; Step S366, change the fourth loop variable i d Increment the value by 1, then proceed to step S361; Step S37: End the current step.
[0025] In step S4, the grouped bend surface list PG is processed. bend Perform adjacent flange face detection to obtain a grouped flange face list PG. flange The specific steps are as follows: Step S41, initialize the grouped flange face list PG flange Let L be empty; flange1 This indicates the list of first flange faces, L. flange1 Initialize to empty; set the second adjacent face list LPn2, which is initialized to empty; Step S42, set the fifth loop variable i e The fifth loop variable i e The initial value of PG is set to 1. bend,ie PG represents the list of grouped bend surfaces bend The i-th e Grouping the curved edge surface; Step S421, if the fifth loop variable i e >N4, jump to step S426, where N4 represents the grouped bend surface list PG bend The number of groups; Step S422, list the first flange face L flange1 Clear; Step S423, set the sixth loop variable i f The sixth loop variable i f The initial value of PG is set to 1. bend,ie,if PG represents the list of grouped bend surfaces bend The i-th e The i-th bend of the group of bends f A curved surface; Step S4231, if the sixth loop variable i f >N5, jump to step S4235, where N5 represents the grouped bend surface list PG bend The i-th e Group of bent side surface PG bend,ie The number of curved surfaces; Step S4232: Clear the second adjacent face list LPn2; clear the grouped bend face list PG. bend The i-th e The i-th side of the group of bent surfaces f A curved surface PG bend,ie,if All outer adjacent faces are added to the second adjacent face list LPn2; Step S4233, set the seventh loop variable i g , the seventh loop variable i g The initial value is set to 1, let LPn 2,ig Represents the i-th face in the second adjacent face list LPn2 g Adjacent faces; Step S42331, if the seventh loop variable i g >N6, jump to step S42337, where N6 represents the number of adjacent faces in the second adjacent face list LPn2; Step S42332, if the i-th face in the second adjacent face list LPn2 g Adjacent faces LPn 2,ig Grouped Bend Surface List PG bend The i-th e The i-th side of the group of bent surfaces f A curved surface PG bend,ie,if If the tangent is not continuous, then skip to step S42336; Step S42333, if the i-th face in the second adjacent face list LPn2 g Adjacent faces LPn 2,ig It is the reference plane Pbase Then proceed to step S42336; Step S42334, if the i-th face in the second adjacent face list LPn2 g Adjacent faces LPn 2,ig In the list of curved surfaces L bend If the condition is met, proceed to step S42336; Step S42335, select the i-th face from the second adjacent face list LPn2. g Adjacent faces LPn 2,ig Add to the first flange face list L flange1 Skip to step S42337; Step S42336, change the seventh loop variable i g Increment the value by 1, then jump to step S42331; Step S42337, end the current step; Step S4234, change the sixth loop variable i f Increment the value by 1, then jump to step S4231; Step S4235: End the current step; Step S424, list the first flange faces L flange1 Add to Grouped Flange Face List PG flange middle; Step S425, change the fifth loop variable i e Increment the value by 1, then jump to step S421; Step S426, end the current step; In step S4, the grouped flange face list PG is processed. flange The bending height is extracted from each group of flange faces to obtain a bending height list L. h1 The specific steps are as follows: Step S43, let PF pg1 This represents the first flange face of the flange face group currently being traversed; the first side list LEg is set. pfpg1 , put the first side list LEG pfpg1 Initialize to empty; set the PF of the first flange face in the currently traversed flange face group to empty. pg1 Add all outer edges to the first edge list LEg pfpg1 In the middle; set the first adjacent face NP pfpg1 Set the first outer edge Eg pfg1 ; Step S44, set the eighth loop variable i h The eighth loop variable i h The initial value is set to 1, let LEg pfpg1,ih Represents the first-side list LEg pfpg1 The i-th h Edge; Step S441, if the eighth loop variable i h If N8 is greater than or equal to N8, then proceed to step S45, where N8 represents the first edge list LEg. pfpg1 The number of edges in the middle; Step S442, set the first flange face PF of the currently traversed flange face group. pg1 First side list LEg pfpg1 The i-th h Striped LEg pfpg1,ih The adjacent face on the first neighbor face NP is assigned a value. pfpg1 ; Step S443, if the first adjacent face NP pfpg1 In the list of curved surfaces L bend In the middle, the first side list LEg pfpg1 The i-th h Striped LEg pfpg1,ih Assigned to the first outer edge Eg pfg1 If so, proceed to step S45; Step S444, change the eighth loop variable i h Increment the value by 1, then jump to step S441; Step S45, change the eighth loop variable i h Set the value to 1; set the height h of the first bend. max Set the height h of the second bend. tmp ; Step S451, if the eighth loop variable i h If N8 is greater than or equal to N8, then proceed to step S46, where N8 represents the first edge list LEg. pfpg1 The number of edges in the middle; Step S452, calculate the first outer edge Eg pfg1 To the first side list LEg pfpg1 The i-th h Striped LEg pfpg1,ih The minimum Euclidean distance is assigned to the second bend height h. tmp ; Step S453, if h tmp h max Then the height h of the second bend will be... tmp Assign the value to the height h of the first bend. max ; Step S454, change the eighth loop variable i h Increment the value by 1, then jump to step S451; Step S46, adjust the height h of the first bend. max Add to the bend height list L h1 middle.
[0026] In step S5, the grouped flange face list PG is processed. flange With reference plane P base Perform the surface extension intersection operation to obtain the first intersection line list L. i1 The specific steps are as follows: Step S51, set the ninth loop variable i i The ninth loop variable i i The initial value is set to 1, let PG flange,ii List of grouped flange faces (PG) flange The i-th i Assemble the flange face, so that PG bend,ii PG represents the list of grouped bend surfaces bend The i-th i Set up the curved surface; set the first common edge list LCoEg1, and initialize the first common edge list LCoEg1 to empty; set the first extended surface PGE. flange,ii Set the first intersection point (Pitsc). f,b .
[0027] Step S511, if the ninth loop variable i i If N9 is selected, proceed to step S515, where N9 represents the grouped flange face list PG. flange The number of groups; Step S512, group the flange face list PG flange The i-th i Flange face PG flange,ii Grouped Bend Surface List PG bend The i-th i Group of bent side surface PG bend,ii Add the common edge to the first common edge list LCoEg1; group the flange face list PG flange The i-th i Flange face PG flange,ii The extended surface obtained by extending along the first common edge list LCoEg1 is assigned to the first extended surface PGE. flange,ii ; Step S513, calculate the first extended surface PGE flange,ii With reference plane P base The intersection line of the planes is assigned to the first intersection line Pitsc. f,b Pitsc, the first intersection line f,b Add to the first intersection list L i1 middle; Step S514, change the ninth loop variable i i The value is increased by 1, and the process jumps to step S511; Step S515: End the current step.
[0028] In step S6, according to the first intersection line list L i1 Grouped flange face list PG flange and reference plane P base The diagonal angle value acquisition operation yields a list of grouped bend angle values LG. a The specific steps are as follows: Step S61, let N sp This indicates the number of sampling points entered by the user on the human-computer interaction interface; Step S62, group the bend angle value list LG a Initialize to empty; Step S63, set the tenth loop variable i j The tenth loop variable i j The initial value is set to 1, let L i1,ij List of first intersection lines L i1 The i-th j Intersection line; let PG flange,ij List of grouped flange faces (PG) flange The i-th j Assembly flange face; Let L angle1 This represents the list of first bend angle values, L. angle1 Initialize to empty; set the first sampling point list LPt. sp1 , the first sampling point list LPT sp1 Initialize to empty; set the first normal plane list LPN3, and initialize the first normal plane list LPN3 to empty; let Len1 represent the first intersection line list L i1 The i-th j Intersection line L i1,ij The length of D is given. sp1 Indicates the first sampling distance; First sampling distance D sp1 The calculation formula is as follows:
[0029] Step S631, if the tenth loop variable i j >N 10 Jump to step S64, where N 10 L represents the list of first intersection lines i1 The number of intersection lines in the middle; Step S632, list the first bend angle values L angle1 Clear; clear the first sampling point list LPt sp1 Clear; Step S633, in the first intersection line list L i1 The i-th j Intersection line L i1,ij According to the first sampling distance Dsp1 Equal-distance sampling is performed with the length as the interval, and the obtained sampling points are added to the first sampling point list LPt. sp1 middle; Step S634: Clear the first normal plane list LPN3; according to the first sampling point list LPT sp1 Each sampling point in the first intersection list L i1 The i-th j Intersection line L i1,ij Construct a normal plane and add the obtained normal plane to the normal plane list LPN3; Step S635, set the eleventh loop variable i k eleventh loop variable i k The initial value is set to 1, let LPN 3,ik The i-th element in the first normal plane list LPN3 k First, define the normal plane; set the second intersection line Pitsc2; set the third intersection line Pitsc3; Step S6351, if the eleventh loop variable i k >N 11 Jump to step S636, where N 11 The number of normal planes in the first normal plane list LPN3; Step S6352, calculate the i-th normal plane in the first normal plane list LPN3. k LPN normal plane 3,ik With reference plane P base The intersection line is assigned to the second intersection line Pitsc2. Step S6353: Calculate the i-th normal plane in the first normal plane list LPN3. k LPN normal plane 3,ik List of grouped flange faces PG flange The flange face of the ij group in the middle PG flange,ij The intersection line is assigned to the third intersection line Pitsc3. Step S6354: If the third intersection line Pitsc3 is a curve segment, then assign the straight line segment connecting the first and last endpoints of the third intersection line Pitsc3 to the third intersection line Pitsc3. Step S6355: Calculate the angle between the second intersection line Pitsc2 and the third intersection line Pitsc3, and add the angle to the first bend angle value list L. angle1 middle; Step S6356, change the eleventh loop variable i k The value is increased by 1, and the process jumps to step S6351; Step S636, end the current step; Step S637, list the first bend angle values L angle1Add to the grouped bend angle value list LG a middle; Step S638, change the tenth loop variable i j The value is increased by 1, and the process jumps to step S631; Step S64: End the current step.
[0030] In step S7, according to the grouped bend angle value list LG a Projection list L of the first intersection line ip1 To mark the oblique angle value in 2D engineering drawing D, the specific steps are as follows: Step S71, set the twelfth loop variable i l The twelfth loop variable i l Let L be initialized to 1. ip1,il List of projections of the first intersection line L ip1 The i-th l Projecting the intersecting lines; making LG a,il LG represents the list of grouped bend angle values a The i-th l Group oblique angle values; let Len2 represent the intersection projection L ip1,il The length of the second sampling distance Dsp2 is set; the first bevel angle value Angle is set. slope .
[0031] Second sampling distance D sp2 The calculation formula is as follows:
[0032] Step S711, if the twelfth loop variable i l >N 12 Jump to step S72, where N 12 List of projections of the first intersection line L ip1 The number of intersection projections in the diagram; Step S712, set the thirteenth loop variable i m The thirteenth loop variable i m Set the initial value of LG to 1. a,il,im LG represents the list of grouped bend angle values a The i-th l The i-th value in the group of oblique angles m One oblique angle value; set the third sampling distance D sp3 Set the first sampling point Pt dsp3 ; Step S7121, if the thirteenth loop variable i m >N sp Skip to step S713; Step S7122, calculate the third sampling distance Dsp3 The third sampling distance D sp3 The calculation formula is:
[0033] Step S7123, in the first intersection line projection list L ip1 The i-th l Intersection line projection L ip1,il Above, project list L from the first intersection line ip1 The i-th l Intersection line projection L ip1,il Starting from the initial point, project list L along the first intersection line. ip1 The i-th l Intersection line projection L ip1,il The curve trajectory, distance D from the third sampling distance sp3 Assign a value to the first sampling point Pt. dsp3 ; Step S7124, calculate the first oblique angle value Angle slope The first diagonal value Angle slope The calculation formula is:
[0034] Step S7125, at the first sampling point Pt dsp3 Create a projection list L perpendicular to the first intersection line. ip1 The i-th l Intersection line projection L ip1,il Create a leader line and create a line on the leader line with the content of the first bevel value Angle. slope The text comment for the value; Step S7126, change the thirteenth loop variable i m Increment the value by 1, then jump to step S7121; Step S713, end the current step; Step S714, change the twelfth loop variable i l Increment the value by 1, then jump to step S711; Step S72, end the current step.
[0035] In step S8, based on the thickness T of the target part C... c List of bending angles L a1 List of inner bending radii L r1 and the list of bend heights L h1 The expanded value list L is obtained through the expanded value calculation operation. flat The specific steps are as follows: Step S81, set the fourteenth loop variable i n The fourteenth loop variable in The initial value is set to 1, let L a1,in List of bending angles L a1 The i-th n A bending angle, making L r1,in List of inner radii of bends L r1 Let L be the inner radius of the i-th bend. h1,in List of bend heights L h1 The i-th n One bend height; set the first unfold value C. flat1 ; Step S811, if the fourteenth loop variable i n >N 12 Jump to step S82, where N 12 List of projections of the first intersection line L ip1 The number of intersection projections in the diagram; Step S813, calculate the first expanded value C flat1 The first expansion value C flat1 The calculation formula is as follows:
[0036] Where π represents the mathematical constant pi, and K is the neutral layer coefficient. In this embodiment, K is taken as 0.42. Step S814, expand the first expanded value C flat1 Add to expanded value list L flat ; Step S815, change the fourteenth loop variable i n Increment the value by 1, then jump to step S811; Step S82, end the current step; In step S8, based on the expanded value list L flat Projection list L of the first intersection line ip1 The template unfolded drawing is generated through the intersection line projection unfolding operation. The specific steps are as follows: Step S83, set the fifteenth loop variable i o The fifteenth loop variable i o The initial value is set to 1, let L flat,io L represents the expanded value list flat The i-th o Let L be an expanded value. ip1,io List of projections of the first intersection line L ip1 The i-th o One intersection line projection; Step S831, if the fifteenth loop variable i o >N 12 Jump to step S84, where N 12 List of projections of the first intersection line Lip1 The number of intersection projections in the diagram; Step S832, project the first intersection line into list L ip1 The i-th o Each intersection projection L ip1,io Projection list L along the first intersection line ip1 The i-th o Each intersection projection L ip1,io List of outward normal direction offset expansion values L flat The i-th o Each expansion value L flat,io The distance; Step S833, change the fifteenth loop variable i o Increment the value by 1, then jump to step S831; Step S84: End the current step and complete the template drawing unfolding.
[0037] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for generating template diagrams, characterized in that, Includes the following steps: Step S1: Read in the target part file to obtain the target part; Step S2: Obtain the specified datum plane in the 3D model of the target part, and take a datum plane reference point on the datum plane; measure the distance from the datum plane reference point along the normal of the datum plane to another surface of the target part to obtain the thickness of the target part; Step S3: Perform adjacent surface detection on the reference surface to obtain a list of grouped bend surfaces; traverse each group of bend surfaces in the list of grouped bend surfaces, extract the bending angle and add it to the bending angle list, and extract the inner bending radius and add it to the inner bending radius list. Step S4: Perform adjacent flange face detection on the grouped flange face list to obtain the grouped flange face list; extract the flange height of each group of flange faces in the grouped flange face list to obtain the flange height list. Step S5: Perform an extension surface intersection operation on the grouped flange surface list and the reference surface to obtain the first intersection line list; Step S6: Based on the first intersection line list, the grouped flange face list, and the reference plane, obtain the grouped bend angle value list through the angle value acquisition operation; Step S7: Based on the reference plane, create a two-dimensional engineering drawing; using the reference plane as the projection plane, orthogonally project each intersection line in the first intersection line list onto the two-dimensional engineering drawing to obtain the intersection line projection; construct the first intersection line projection list based on the intersection line projection; perform the oblique angle value marking operation in the two-dimensional engineering drawing according to the grouped bend angle value list and the first intersection line projection list; Step S8: Based on the target part's thickness, bending angle list, bending inner radius list, and bend height list, obtain the unfolded value list through unfolded value calculation operation; based on the unfolded value list and the first intersection line projection list, generate the template unfolded drawing through intersection line projection unfolding operation; Step S6, which involves obtaining the list of grouped bend angle values through the angle value acquisition operation, includes: Get the number of sampling points preset by the user; Calculate the length of each first intersection line in the first intersection line list, and calculate the first sampling distance: ; Among them, D sp1 N represents the first sampling distance, Len1 represents the length of the first intersection line in the first intersection line list, and N represents the first sampling distance. sp This indicates the number of sampling points input by the user on the human-computer interaction interface. Sampling points are obtained by sampling at equal intervals along the length direction of the first intersection line with the first sampling distance as the interval. A normal plane that passes through the sampling points and is perpendicular to the intersection line is constructed, and all normal planes are stored in the normal plane list. Calculate the intersection line of each normal plane in the normal plane list with the datum plane as the second intersection line, and calculate the intersection line of each normal plane in the normal plane list with the flange face corresponding to the first intersection line as the third intersection line; if the third intersection line is a space curve, then use the straight line segment connecting its first and last endpoints to represent it. Calculate the angle between the second and third intersection lines and use the angle as the slope value at the sampling point; after traversing all sampling points on a first intersection line, group these slope values and add them to the grouped bend slope value list. In step S8, based on the target part's thickness, bending angle list, inner bending radius list, and bend height list, the specific process of obtaining the unfolded value list through unfolded value calculation is as follows: Calculate the first expanded value using the following formula: ; in, The first expansion value, For the i-th bend in the list of inner radii n One inner radius value, For the i-th bend angle in the list n One bending angle value, For the i-th bend height in the list n The bending height value, K, is a coefficient obtained from the bending coefficient table based on the target part material. Let π be the thickness of the target part and π be the value of pi; add the first unfolded value to the unfolded value list.
2. The template drawing generation method according to claim 1, characterized in that, The process of obtaining the grouped bending surface list in step S3 includes: adding all surfaces adjacent to the outer edge of the reference surface to the candidate bending surface list; filtering out candidate surfaces in the candidate bending surface list that are tangentially continuous with the reference surface to construct the bending surface list; and merging the bending surfaces in the bending surface list that are spatially adjacent through edges into the same group to obtain a grouped bending surface list composed of multiple bending surface groups.
3. The template drawing generation method according to claim 2, characterized in that, The specific steps for extracting the bending angle and inner bending radius in step S3 include: for a group of bending surfaces in the grouped bending surface list, identifying whether the outer edge of the first bending surface in the bending surface group is an arc; when the outer edge is identified as an arc, obtaining the central angle corresponding to the arc segment from the starting point of the arc along the arc path to the ending point of the arc, and adding the central angle as the bending angle to the bending angle list; at the same time, obtaining the arc radius, subtracting the thickness of the target part from the arc radius to obtain the inner radius, and adding the inner radius to the inner bending radius list.
4. A template drawing generation method according to claim 3, characterized in that, The operation of obtaining the grouped flange face list in step S4 includes: filtering out all the outer adjacent faces of each bend face in each group of bend faces in the grouped bend face list; identifying adjacent faces that are tangentially continuous with the bend faces in the grouped bend face list, are not the reference faces, and are not included in the bend face list as flange faces; and forming a flange face group by the set of flange faces belonging to the same group of bend faces. All flange face groups constitute the grouped flange face list.
5. A template drawing generation method according to claim 4, characterized in that, The process of extracting the bend height in step S4 includes: for each flange group in the grouped flange face list, determining the common edge of the flange face in the flange face group and the bend face in the corresponding bend face group as the reference edge, calculating the minimum Euclidean distance from all outer edges of the flange face in the flange face group to the reference edge, obtaining a set of distance values, taking the maximum value in this set of distance values as the bend height of the flange face group, and adding it to the bend height list.
6. A method for generating a template drawing according to claim 5, characterized in that, The operation of obtaining the first intersection list in step S5 specifically includes: for each flange group in the grouped flange group list, finding the common edge between the corresponding bend face groups of the flange group, these common edges constitute the first common edge list, extending the flange group in the direction of the first common edge list to obtain the extended surface; calculating the intersection line between the extended surface and the plane where the reference surface is located, defining the intersection line as the first intersection line, and adding the first intersection line to the first intersection line list.
7. A method for generating a template drawing according to claim 6, characterized in that, The specific process of marking the oblique angle value on the two-dimensional engineering drawing D in step S7 includes: Calculate the second sampling distance D sp2 and the third sampling distance D sp3 : ; ; Where Len2 represents the length of the first intersection projection list, N sp This indicates the number of sampling points entered by the user on the human-computer interaction interface. This refers to the number of the angled value in the angled value group within the list of grouped bend angled value groups; Take a point at a distance from the third sampling distance on the intersection projection of the first intersection projection list as an auxiliary annotation point; create a short line perpendicular to the intersection projection at this annotation point as a leader line; subtract 90 degrees from the bevel angle value to obtain the bevel angle value used for engineering annotation, and automatically generate a text annotation next to the leader line, which is the calculated bevel angle value.
8. The template drawing generation method according to claim 7, characterized in that, The specific process of generating the template unfolded drawing in step S8 by unfolding the intersection projection according to the unfolded value list and the first intersection projection list includes: offsetting each intersection projection in the first intersection projection list along the outer normal direction in the two-dimensional engineering drawing D, with the offset amount being the unfolded value corresponding to the intersection projection in the unfolded value list, so as to generate the template drawing.
Citation Information
Patent Citations
Method for fast marking oblique angle value of flanging part
CN104732036A
Rapid airplane template design system and method
CN104850724A