Component modeling and parameterization method, system, electronic device and storage medium

Through split clustering and shape recognition technology, the parameterized model of components is automatically generated, which solves the problem of low efficiency of manual simplification model in the existing technology, and improves the calculation speed and result accuracy.

CN114491922BActive Publication Date: 2025-04-04VAYO SHANGHAI TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111503423.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2025-04-04
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

In PCBA design, there are many types of component models and complex. The existing technology relies on manual extraction of key sizes, resulting in low efficiency and error-proneness, which increases the cost of model library maintenance.

Method used

By obtaining component model data, splitting and clustering, distinguishing the ontology and pins, identifying shape types, and calculating the size of each part to generate parameterized model data.

Benefits of technology

It realizes automated output and simplify model files, improves the distinction between component body and pins, reduces manual intervention, and improves the calculation speed of model analysis and simulation software and the accuracy of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491922B_ABST
    Figure CN114491922B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, electronic device and storage medium for component modeling and parameterization, the method comprising: obtaining component model data; splitting and clustering the component model according to the information in the model data; distinguishing the body and pins of the component model according to the result of the splitting and clustering, and obtaining a body sequence set and a pin sequence set; judging the shapes of the body and pins respectively, and identifying the shape type of the pins; obtaining the size of the body based on the shape of the body and the bounding box of the body, and obtaining the size of the pin based on the shape, shape type and bounding box of the pins; and outputting parameterized model data. The present invention can automatically output a simplified model file, with less manual intervention, high differentiation between the component body and pins, and effectively improving the calculation speed of model analysis and simulation software and the accuracy of the results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electronic manufacturing, and in particular relates to a method, system, electronic equipment and storage medium for component modeling and parameterization. Background Art

[0002] In the PCBA (Printed Circuit Board Assembly) design process, there are many types of component models and the number is huge, making model design and simulation analysis difficult. The original device description was mainly based on boundary representation, grid model and other methods. The CAD models represented by these methods are too detailed and complex. If they are directly used in DFM (Design for manufacturability) and simulation software, the data volume is large and the analysis and calculation efficiency is low.

[0003] Currently, the industry can only manually extract key dimensions of CAD models and create component parametric models for use in DFM, simulation and other software.

[0004] However, manually simplifying models is too inefficient, prone to errors, and difficult to audit, resulting in high maintenance costs for the model library. Summary of the invention

[0005] In order to solve the above problems existing in the prior art, the present invention provides a method, system, electronic device and storage medium for component modeling and parameterization. The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0006] A component modeling and parameterization method, comprising:

[0007] Get component model data;

[0008] Splitting and clustering the component model according to the information in the model data;

[0009] According to the splitting and clustering result, the body and the pins of the component model are distinguished to obtain a body sequence set and a pin sequence set, wherein the body sequence set contains each body bounding box, and the pin sequence set contains each pin bounding box;

[0010] Determining the shapes of the body and the pins respectively, and identifying the shape type of the pins;

[0011] The size of the body is obtained based on the shape of the body and the bounding box of the body, and the size of the pin is obtained based on the shape of the pin, the shape type and the bounding box of the pin;

[0012] Export parameterized model data.

[0013] An embodiment of the present invention further provides a component modeling and model parameterization system, including:

[0014] An acquisition module, used to acquire component model data;

[0015] A splitting and clustering module, used for splitting and clustering the component model according to the information in the model data;

[0016] A sequence set generation module, which distinguishes the body and the pins of the component model according to the result of the split clustering, and obtains a body sequence set and a pin sequence set, wherein the body sequence set contains each body bounding box, and the pin sequence set contains each pin bounding box;

[0017] An identification module, used to determine the shapes of the body and the pins, and to identify the shape type of the pins;

[0018] A size calculation module, used to obtain the size of the body based on the shape of the body and the bounding box of the body, and to obtain the size of the pin based on the shape of the pin, the shape type and the bounding box of the pin;

[0019] Output module, used to output parameterized model data.

[0020] An embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0021] Memory for storing computer programs;

[0022] The processor is used to implement the method steps described in any of the above embodiments when executing the computer program.

[0023] An embodiment of the present invention further provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any of the above embodiments are implemented.

[0024] Beneficial effects of the present invention:

[0025] 1. Compared with the previous manually simplified models, the method of the present invention can automatically output the simplified model file, and the component body and pins are highly distinguished, with less manual intervention, which greatly reduces the workload of modelers and effectively improves the calculation speed of model analysis and simulation software, as well as the accuracy of the results.

[0026] 2. The method of the present invention can automatically generate a parametric model. The software can automatically identify the body and pins of the model, as well as the shapes of the body and pins, extract the key dimensions of the body and pins, and use the parameterized body and pin shapes to replace the original model, thereby simplifying the model structure and greatly reducing the amount of model data.

[0027] 3. The method of the present invention can automatically generate component model parameters, and by distinguishing the component body and the pins and assigning different attribute values, it is convenient for parametric modeling and easy to use in different scenarios.

[0028] 4. The method of the present invention can serve MBD (Model Based Definition), provide complete product definition information, make data quality more accurate, and effectively reduce the error rate of the production process.

[0029] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flowchart of a method for component modeling and parameterization provided by an embodiment of the present invention;

[0031] Figure 2 It is a flowchart of a method for obtaining a bounding box sequence set provided by an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of a bounding box provided by an embodiment of the present invention;

[0033] Figure 4 Schematic diagram of three different shapes of bodies provided by embodiments of the present invention;

[0034] Figure 5 is a schematic diagram of a J6 pin layout provided by an embodiment of the present invention;

[0035] Figure 6 is a schematic diagram of a J8 pin layout provided by an embodiment of the present invention;

[0036] Figure 7 is a schematic diagram of a polygonal projection of a J6 pin provided by an embodiment of the present invention;

[0037] Figure 8 is a schematic diagram of a polygonal projection of a J8 pin provided by an embodiment of the present invention;

[0038] Fig. 9 is a three-dimensional diagram of a J2 pin provided by an embodiment of the present invention;

[0039] Fig.10 is a three-dimensional diagram of a J6 pin provided by an embodiment of the present invention;

[0040] Fig.11 is a three-dimensional diagram of a J8 pin provided by an embodiment of the present invention;

[0041] Fig.12 is a three-dimensional diagram of a J10 pin provided by an embodiment of the present invention;

[0042] Fig.13 is a three-dimensional diagram of a J14 pin provided by an embodiment of the present invention;

[0043] Fig.14 is a schematic diagram of an algorithm for calculating an outer contour provided by an embodiment of the present invention;

[0044] Fig.15 is a schematic diagram of a component model provided by an embodiment of the present invention;

[0045] Fig.16 is a cross-sectional schematic diagram of a J6 pin provided by an embodiment of the present invention;

[0046] Fig.17 is a cross-sectional schematic diagram of a J8 pin provided by an embodiment of the present invention;

[0047] Fig.18 is a cross-sectional schematic diagram of a J10 pin provided by an embodiment of the present invention;

[0048] Fig.19 is a schematic diagram of a component modeling and model parameterization system provided by an embodiment of the present invention;

[0049] Fig. 20 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0051] Embodiment 1

[0052] See also Figure 1 , Figure 1 This is a flow chart of a component modeling and parameterization method provided by an embodiment of the present invention. This embodiment provides a component modeling and parameterization method, which may include steps 1 to 10. It should be clear that the order of the steps set in this embodiment is only a specific implementation method. In actual application, the order can be adjusted according to actual conditions. Therefore, this embodiment does not limit the specific order of steps. Among them:

[0053] Step 1: Get component model data.

[0054] Specifically, first read in mechanical 3D CAD design files, including files in step, stl and other formats. Then obtain the model data of components from the above mechanical 3D CAD design files, including: model type (parts and assemblies), part names, assembly relationships, absolute coordinate system WorldCsys (origin is (0.0, 0.0, 0.0), X-axis direction vector (1.0, 0.0, 0.0), Y-axis direction vector (0.0, 1.0, 0.0), Z-axis direction vector (0.0, 0.0, 1.0)), geometric data of points, lines and surfaces, and color information.

[0055] Step 2: Split and cluster the component model based on the information in the model data.

[0056] In a specific embodiment, step 2 may include:

[0057] The num groups divided based on the color information of the faces in the model data are used to obtain a number of subgroups, so as to obtain a sequence set List according to all the subgroups.

[0058] Specifically, this embodiment groups all faces according to color, divides faces of the same color into a group according to the color of each face, and then divides the num groups into several subgroups, each subgroup includes: all faces of a single part, or several faces with the same color and connected outer contours, and obtains the bounding box of each subgroup by calculation. Based on the above content, a sequence set List including all subgroups can be obtained. The sequence set List includes several subgroups arranged in a preset order, and the bounding box is the minimum circumscribed cube of the subgroup, wherein the preset order can be sorting according to the size of the bounding box, for example, the preset order is to sort the bounding box volume from large to small.

[0059] In a specific embodiment, see Figure 2 , the specific ways to obtain the sequence set List can include:

[0060] Step 2.1: Group all faces according to the face color information in the model data to obtain num groups, wherein all faces in each group have the same color.

[0061] Step 2.2: When num>1, or num=1 and the model type is part, all faces in each group are divided into several subgroups according to the principle of connected outer contours. When num=1 and the model type is assembly, each part of the model is divided into different subgroups, that is, one part corresponds to one subgroup. Therefore, each subgroup can include: all faces of a single part, or several faces with the same color and connected outer contours.

[0062] That is to say, if num>1, ignore the assembly relationship and execute the step shown in 2.21; if num=1, if the model type=assembly, divide all faces of each part into different subgroups and execute the step shown in 2.3; if the model type=part, execute the step shown in 2.21.

[0063] Step 2.21: Divide all faces in each group into N subgroups based on the principle that their outer contours are connected.

[0064] The outer contours being connected means that there is at least one collinear line between the outer contours of two adjacent faces.

[0065] Step 2.3: Loop through all faces and extract the contour points of each face in each subgroup.

[0066] Step 2.4: Obtain the volume of the bounding box based on the maximum and minimum coordinate values ​​of x, y, and z in the contour points.

[0067] Specifically, Figure 3 As shown, for each subgroup, the maximum x coordinate value and the minimum x coordinate value among the x coordinate values ​​of all points, the maximum y coordinate value and the minimum y coordinate value among the y coordinate values, and the maximum z coordinate value and the minimum z coordinate value among the z coordinate values ​​are obtained, and the minimum x, y, and z coordinate values ​​are used as the minimum point minPnt of the bounding box, and the maximum x, y, and z coordinate values ​​are used as the maximum point maxPnt of the bounding box.

[0068] Calculate the length, width, and height of each bounding box, where the length Lbox = maxPnt.x–minPnt.x, the width Wbox = maxPnt.y–minPnt.y, the height Hbox = maxPnt.z–minPnt.z, and the volume of the bounding box Vbox = Lbox×Wbox×Hbox, where maxPnt.x, maxPnt.y, and maxPnt.z represent the x, y, and z coordinate values ​​of the maximum point maxPnt of the bounding box, respectively, and minPnt.x, minPnt.y, and minPnt.z represent the x, y, and z coordinate values ​​of the minimum point minPnt of the bounding box, respectively.

[0069] Step 2.5: Sort all subgroups according to the size of the bounding box to obtain a sorting result.

[0070] Specifically, all subgroups are sorted in order from large to small or from small to large according to the bounding box volume Vbox to form a sorting result, which is an initial sequence set List. If the bounding box volumes are the same, they are sorted according to the order of the subgroup numbers, for example, sorted in order from large to small (this embodiment is explained using this as an example). The initial sequence set List = {Box1: subgroup 1, Box2: subgroup 2, Box3: subgroup 3, ..., BoxN: subgroup N}.

[0071] Step 2.6: Based on the sorting result, a List sequence set is obtained according to the inclusion relationship between the i-th bounding box and each bounding box after the i-th bounding box.

[0072] Specifically, the inclusion relationship between the i-th bounding box and each bounding box after the i-th bounding box is determined respectively. If it is an inclusion relationship, the contained bounding box and the subgroup corresponding to the bounding box are deleted from the initial sequence set List to obtain the final sequence set List.

[0073] In a specific embodiment, step 2.6 may include:

[0074] Based on the sorting results, the relationship between the coordinate values ​​of the i-th bounding box and each bounding box after the i-th bounding box is determined respectively. If the minimum x, y, and z coordinate values ​​of the i-th bounding box are all less than or equal to the minimum x, y, and z coordinate values ​​of the j-th bounding box, and the maximum x, y, and z coordinate values ​​of the i-th bounding box are all greater than or equal to the maximum x, y, and z coordinate values ​​of the j-th bounding box, then the i-th bounding box contains the j-th bounding box, and the j-th bounding box and the subgroup corresponding to the j-th bounding box are deleted from the initial sequence set to obtain a sequence set List, wherein the j-th bounding box is any bounding box after the i-th bounding box.

[0075] That is to say, according to the above bounding box sorting results, the inclusion relationship between each sub-group bounding box in the initial sequence set List and all subsequent sub-group bounding boxes is calculated respectively. The calculation process is such as Box1.minPnt.x≤Box2.minPnt.x, Box1.minPnt.y≤Box2.minPnt.y, Box1.minPnt.z≤Box2.minPnt.z, Box1.maxPnt.x≥Box2.maxPnt.x, Box1.maxPnt.y≥Box2.maxPnt.y, Box1.maxPnt.z≥Box2.maxPnt.z. When the above 6 conditions are met at the same time, the bounding box Box1 completely contains the bounding box Box2. In the initial sequence set List Delete element (Box2: subgroup 2); otherwise continue until all subgroups are deduplicated, where Box1.minPnt.x, Box1.minPnt.y, Box1.minPnt.z, Box2.minPnt.x, Box2.minPnt.y and Box2.minPnt.z represent the x, y and z coordinate values ​​of the minimum point minPnt of the bounding box Box1 and the bounding box Box2 respectively, and Box1.maxPnt.x, Box1.maxPnt.y, Box1.maxPnt.z, Box2.maxPnt.x, Box2.maxPnt.y and Box2.maxPnt.z represent the x, y and z coordinate values ​​of the maximum point maxPnt of the bounding box Box1 and the bounding box Box2 respectively.

[0076] Step 3: According to the results of split clustering, the ontology and pins of the component model are distinguished to obtain an ontology sequence set and a pin sequence set.

[0077] In a specific embodiment, step 3 may include:

[0078] According to the first volume ratio r1 and the second volume ratio r2, the body sequence set and the pin sequence set are obtained, r1=Vbox / Vmax, r2=Vmin / Vbox, Vbox is the volume of the subgroup bounding box to be distinguished, Vmax is the volume of the maximum bounding box, and Vmin is the volume of the minimum bounding box; wherein, the body sequence set contains the bounding boxes of each body, and the pin sequence set contains the bounding boxes of each pin.

[0079] Specifically, the relationship between the first volume ratio r1 and the second volume ratio r2 is determined. If the first volume ratio r1 is greater than or equal to the second volume ratio r2, the current subgroup to be distinguished is the body, otherwise the current subgroup to be distinguished is the pin, until all subgroups are distinguished to obtain the body sequence set and the pin sequence set.

[0080] That is to say, the subgroup with the largest bounding box volume among all subgroups is regarded as the body (volume is Vmax), and the subgroup with the smallest volume is regarded as the pin (volume is Vmin). The calculation process of the remaining subgroups is as follows: according to the bounding box volume Vbox, the volume ratios r1 and r2 to the above-mentioned body and pins are calculated respectively. If r1≥r2, this subgroup is the body, otherwise it is the pin, until all subgroups are distinguished, and finally a body sequence set BodyList={Box1': subgroup 1', Box2': subgroup 2', Box3': subgroup 3', ..., BoxN': subgroup N'} is formed (most components have only one body, and very few components have multiple bodies), and a pin sequence set PinList={Box1": subgroup 1", Box2": subgroup 2", Box3": subgroup 3", ..., BoxN": subgroup N"}, where List=BodyList∪PinList, N=N'+N".

[0081] Step 4: Determine the shapes of the body and the pins respectively, and identify the shape type of the pins.

[0082] Step 4.1: Project each entity in the entity sequence set along the X, Y and Z axis directions of the local coordinate system to obtain the shape of the entity.

[0083] In this embodiment, it is necessary to create a local coordinate system LocalCsys. The method for establishing the local coordinate system LocalCsys is as follows:

[0084] Step 1. In the absolute coordinate system WorldCsys, obtain the vector zV (vx, vy, vz) pointing from the center of all pins to the center of all bodies.

[0085] Step 2. According to the pin bounding box obtained in step 3, determine whether the projections of the bounding boxes of all pins along the coordinate axes X, Y and Z are overlapped. If there is no overlap in a certain direction, add the coordinate value of the vector zV corresponding to that direction to the sequence set Vlist. For example, if there is no overlap in the X-axis direction, add vx in the vector zV to the sequence set Vlist, and the sequence set Vlist sorts the coordinate values ​​in descending order according to the absolute value of the coordinate value. When the absolute values ​​of the coordinate values ​​are the same, the sorting priority order is vz, vy, vx, that is, vz takes precedence over vy, and vy takes precedence over vx. Among them, the coordinate value of the vector zV corresponding to the overlapping direction is useless data.

[0086] Step 3. Select the direction corresponding to the first coordinate value in the sequence set Vlist as the direction of the Z axis of the local coordinate system LocalCsys.

[0087] Step 4. Based on the positive and negative signs of the first coordinate value in the sequence set Vlist, determine the positive and negative directions of the Z-axis direction of the local coordinate system LocalCsys relative to the corresponding coordinate axis of the absolute coordinate system WorldCsys. That is, when the first coordinate value is greater than or equal to 0, the Z-axis direction of the local coordinate system LocalCsys is the same as the direction of the corresponding coordinate axis of the absolute coordinate system WorldCsys; otherwise, the Z-axis direction of the local coordinate system LocalCsys is opposite to the direction of the corresponding coordinate axis of the absolute coordinate system WorldCsys.

[0088] In a specific embodiment, step 4.1 may include steps 4.11-4.12, wherein:

[0089] Step 4.11, project the body along the X, Y, and Z axis directions of the local coordinate system LocalCsys to obtain the three first projection shapes in the X, Y, and Z axis directions, that is, under the local coordinate system LocalCsys, project the pin along the coordinate axes X, Y, and Z directions to the coordinate system planes YOZ, ZOX, and XOY respectively to obtain the projected shapes.

[0090] Step 4.12: Figure 4 As shown, the shape of the body is determined according to the three first projection shapes. If the three first projection shapes are all rectangular, the shape of the body is a cube; if one of the three first projection shapes is a circle, the shape of the body is a cylinder; the shapes of the remaining bodies are all polygons.

[0091] Step 4.2: Project each pin in the pin sequence set along the X, Y and Z axis directions of the local coordinate system to obtain the shape of the pin and identify the shape type of the pin.

[0092] In a specific embodiment, step 4.2 may include steps 4.21 to 4.26, wherein:

[0093] Step 4.21, project each pin in the pin sequence set PinList along the X, Y, and Z axis directions of the local coordinate system LocalCsys to obtain three second projection shapes in the X, Y, and Z axis directions, that is, under the local coordinate system LocalCsys, project the body along the coordinate axes X, Y, and Z directions to the coordinate system planes YOZ, ZOX, and XOY respectively to obtain the projected shapes. The three second projection shapes are recorded as Sx, Sy, and Sz respectively.

[0094] Step 4.22, judging the shape of the pin according to the three second projection shapes, first, if the three second projection shapes are all rectangular, the shape of the pin is a cube; second, if the three second projection shapes are all circular, the shape of the pin is a sphere; third, if one of the three second projection shapes is a circle, the shape of the pin is a cylinder; finally, the shapes of the remaining pins are polygons;

[0095] Step 4.23. Calculate the distribution characteristics of each pin in the top view of the component (looking from the positive direction of the Z axis to the negative direction of the Z axis), and use the positional relationship between the pin and the body in the top view as the distribution characteristics of the pin.

[0096] In a specific embodiment, step 4.23 may include steps 4.231-4.232, wherein:

[0097] Step 4.231, obtain the outer contour line of the body projected along the Z-axis direction and the outer contour points of the pin projected along the Z-axis direction.

[0098] Step 4.232, determine the positional relationship between the outer contour points of the pin and the outer contour line of the body. If all the outer contour points of the pin are on the outer contour line of the body, the pin is deemed to be within the outer contour line of the body; the rest are based on whether the outer contour points of the pin are within or outside the outer contour line of the body, and the points on the outer contour line of the body are ignored. The positional relationship between the outer contour points of the pin and the outer contour line of the body is determined based on the remaining points: if the remaining outer contour points of the pin are all within the outer contour line of the body, the outer contour points of the pin are within the outer contour line of the body; if the remaining outer contour points of the pin are all outside the outer contour line of the body, the outer contour points of the pin are outside the outer contour line of the body; if the remaining part of the outer contour points of the pin are outside the outer contour line of the body and the remaining part of the outer contour points of the pin are within the outer contour line of the body, the pin intersects with the body, for example Figure 5 and Figure 6 shown.

[0099] Step 4.24, based on the local coordinate system LocalCsys, calculate the overlapping length of each pin with all the bodies on the X, Y and Z axes respectively, and calculate the body overlap and pin overlap based on the overlapping length respectively, so as to use the body overlap and pin overlap as the local features of the pin.

[0100] In a specific embodiment, step 4.24 may include steps 4.241 to 4.243, wherein:

[0101] Step 4.241: In the local coordinate system LocalCsys, calculate the bounding box bodyBox1 of all bodies and the bounding box pinBox1 of the current pin. Taking the X-axis as an example: Take the larger value between bodyBox1.minPnt.x and pinBox1.minPnt.x as X1, and take the smaller value between bodyBox1.maxPnt.x and pinBox1.maxPnt.x as X2. If X1 ≥ X2, the overlap degree of the body and the pin on the X-axis is 0; otherwise, the overlap length overLen = X2 – X1. Here, bodyBox1.minPnt.x and bodyBox1.maxPnt.x respectively represent the x-coordinate values of the minimum point minPnt of the bounding box bodyBox1 and the bounding box pinBox1, and bodyBox1.maxPnt.x and pinBox1.maxPnt.x respectively represent the x-coordinate values of the maximum point maxPnt of the bounding box bodyBox1 and the bounding box pinBox1. The calculation methods for the overlap lengths regarding the Y-axis and the Z-axis are the same as above and will not be elaborated here.

[0102] Step 4.242: Based on the preset axes, select the larger value between the minimum coordinate value of the bounding box of all bodies and the minimum coordinate value of the bounding box of the current pin as D1, and select the smaller value between the maximum coordinate value of the bounding box of the bodies and the maximum coordinate value of the bounding box of the current pin as D2. The preset axes include the X-axis, the Y-axis, and the Z-axis. Taking the X-axis as an example, D1 is X1 in Step 4.241, and D2 is X2 in Step 4.241.

[0103] Step 4.243: Judge the relationship between D1 and D2. If D1 ≥ D2, the overlap degree of the body and the overlap degree of the pin on the preset axis are both 0. If D1 < D2, the overlap degree of the body is overLen / (body1 - body2), and the overlap degree of the pin is overLen / (pin1 - pin2). Here, body1 and body2 are respectively the maximum and minimum coordinate values of the bounding box of the body on the preset axis, and pin1 and pin2 are respectively the maximum and minimum coordinate values of the bounding box of the pin on the preset axis.

[0104] Specifically, taking the X-axis as an example, if X1 ≥ X2, the overlap degree of the body and the pin on the X-axis is 0; otherwise, the overlap degree of the body on the X-axis is overLen / (bodyBox1.maxPnt.x - bodyBox1.minPnt.x), and the overlap degree of the pin on the X-axis is overLen / (pinBox1.maxPnt.x - pinBox1.minPnt.x). Similarly, the calculation methods for the overlap degrees of the body and the pin on the Y-axis and the Z-axis are the same as the above method.

[0105] Step 4.25: According to the three second projection shapes of the pin, obtain the contour features of each projection respectively.

[0106] In a specific embodiment, step 4.25 may include steps 4.251-4.253, wherein:

[0107] Step 4.251, such as Figure 7 and Figure 8 As shown, based on the preset axis, a horizontal auxiliary line Guid1 is made through the center of the pin projection shape to obtain two intersection points of the horizontal auxiliary line Guid1 and the pin projection shape.

[0108] Step 4.252, draw two vertical auxiliary lines Guid2 and Guid3 through the two intersection points, wherein the vertical auxiliary line Guid3 is on the right side of the vertical auxiliary line Guid2;

[0109] Step 4.253, determine the relationship between the vertex of the pin projection and the horizontal auxiliary line Guid1, vertical auxiliary line Guid2, and Guid3. If the vertex is above the horizontal auxiliary line Guid1 and to the right of the vertical auxiliary line Guid3, the vertex is in the first area, that is, the first area; if the vertex is above the horizontal auxiliary line Guid1 and to the left of the vertical auxiliary line Guid2, the vertex is in the second area, that is, the second area; if the vertex is below the horizontal auxiliary line Guid1 and to the left of the vertical auxiliary line Guid2, the vertex is in the third area, that is, the third area; if the vertex is below the horizontal auxiliary line Guid1 and to the right of the vertical auxiliary line Guid3, the vertex is in the fourth area, that is, the fourth area, and the combination of the areas where all vertices on both sides of the vertical auxiliary line Guid2 and the vertical auxiliary line Guid3 are located is used as the contour feature of the pin projection; when all vertices are on or / and between the vertical auxiliary line Guid2 and the vertical auxiliary line Guid3, the contour feature is empty.

[0110] It should be noted that the present invention does not impose any unique restriction on the order of obtaining the above-mentioned local features, distribution features and contour features, and the order can be adjusted in the actual process.

[0111] Step 4.26: Distinguish the shape type of the pin according to the shape and / or distribution characteristics and / or local characteristics and / or contour characteristics of the pin.

[0112] Specifically, for different pin types, the shape type of each pin can be determined according to the above content. This embodiment takes 5 pin types as an example, named J2, J6, J8, J10, and J14, and analyzes and judges them. The judgment method for other types of pins can be determined according to the specific pins by referring to the above content. This embodiment will not go into details about other pin types.

[0113] According to the following criteria, the shape type of each pin is judged in turn. The specific criteria are as follows

[0114] (1) J2 pin identification criteria, J2 pin as follows Fig. 9 shown.

[0115] 1) Pin shape: Both the body and the pins are cubes;

[0116] 2) Contour features: The contour features of the three projections of the pin are all empty;

[0117] 3) Local features: For each pin, the body overlap is 100% in at least two directions of the coordinate axes X, Y, and Z;

[0118] When the above three conditions are met at the same time, the pin shape type is J2.

[0119] (2) J6 pin identification criteria, J6 pin as follows Fig.10 shown.

[0120] 1) Distribution characteristics: such as Figure 5 As shown, in the top view, the pins are outside the outer contour of the body;

[0121] 2) Pin shape: The pin is a polygon (among the three projections of the pin, Sz is a rectangle, and one of Sx and Sy is a polygon);

[0122] 3) Contour feature: Among the three projection shapes of the pin, one projection shape satisfies that all vertices outside its two vertical auxiliary lines are in areas ①, ③ or areas ②, ④;

[0123] When the above three conditions are met at the same time, the pin shape type is J6.

[0124] (3) J8 pin identification criteria, J8 pin as follows Fig.11 shown.

[0125] 1) Distribution characteristics: such as Figure 6 As shown, in the top view, the pin intersects with the outer contour of the body;

[0126] 2) Pin shape: The pin is a polygon (among the three projections of the pin, Sz is a rectangle, and at least one of Sx and Sy is a polygon);

[0127] 3) Contour feature: The contour feature of at least one polygon in the projection of the pin is: among the three projection shapes of the pin, one projection shape satisfies that all polygon vertices outside its two vertical auxiliary lines are in areas ①, ④ or areas ②, ③;

[0128] 4) Local features: For each pin, the overlap between the body and the pin in the Z direction of the coordinate axis is less than 100%;

[0129] When the above four conditions are met at the same time, the pin shape type is J8.

[0130] (4) J10 pin identification criteria, J10 pin Fig.12 shown.

[0131] 1) Distribution characteristics: In the top view, the pins are inside the outer contour of the body;

[0132] 2) Pin shape: The pin shape is a sphere;

[0133] When both of the above conditions are met, the pin shape type is J10.

[0134] (5) The criteria for determining the J14 pin: Fig.13 shown.

[0135] 1) Distribution characteristics: In the top view, the pins are inside the outer contour of the body;

[0136] 2) Pin shape: cube, cylinder or polygon (in the three projections of the pin, Sx and Sy are rectangles, and Sz is a polygon);

[0137] 3) Contour features: When the pin shape is a cube or a cylinder, the contour features of the three projections of the pin are all empty; when the pin shape is a polygon, the contour features of the pin projections in the X and Y directions are all empty;

[0138] 4) Local features: The overlap of the pins in the X and Y directions is 100%, the overlap of the pins in the Z direction is 0, and they are completely below the body (negative direction of the Z direction);

[0139] When the above four conditions are met at the same time, the pin shape type is J14.

[0140] In a specific embodiment, the projection shape determination method includes:

[0141] Step 1, discretize the curve. Traverse all the edges of the body or pins, discretize all the edges by length, split all the edges in sequence, and obtain the line segment set Set, Set = {seg1, seg2, ..., segN}.

[0142] Step 2. Project the line segments in the line segment set Set along the preset direction onto the coordinate system plane in sequence to obtain the projected line segment set Set', Set' = {seg1', seg2', ..., segN'}, the preset direction includes the X, Y and Z axis directions. For example, if the preset direction is the Z axis direction, the line segments in the line segment set Set are projected along the coordinate axis Z axis direction onto the coordinate system XOY plane to obtain the projected line segment set Set'.

[0143] Step 3. Obtain the contour area S and the area S of the minimum circumscribed rectangle based on the vertices of the outer contour of the line segment set Set' 矩形 and the area of ​​the smallest circumscribed circle S 圆 .

[0144] Specifically, calculate the vertex set W of the outer contour of the line segment set Set', extract its contour area S, and obtain the area S of the rectangular bounding box R rectangle (i.e., the minimum circumscribed rectangle) of the outer contour vertex set W respectively. 矩形 and the area S of the circumscribed circle of the minimum circumscribed circle C 圆 .

[0145] Step 4, according to r 矩形 、r 矩形 The area ratio threshold K, r 圆 and r 圆 The area ratio threshold K1 determines the projection shape. If r 矩形 >r 圆 And r 矩形 >K, the projection shape is a rectangle; if r 圆 >r 矩形 And r 圆 >K1, the projection shape is a circle, otherwise the projection shape is a polygon, where r 矩形 =S / S 矩形 , r 圆 =S / S 圆 In practical applications, the preset values ​​of K and K1 are preferably set to 0.85 and 0.9 respectively. K and K1 can be adjusted according to actual needs, and this embodiment does not make any specific limitation to this.

[0146] In a specific embodiment, a method for obtaining vertices of the outer contour lines of the line segment set Set' includes:

[0147] Step 1. Determine whether each line segment in the line segment set Set' intersects with other line segments in turn (when the line segments overlap, the endpoints of the overlapping parts are regarded as two intersection points). If there is an intersection and the intersection point is not at the endpoint of the line segment, the line segment is split from the intersection point. If there is no intersection point or there is an intersection point and the intersection point is at the endpoint of the line segment, continue to calculate the next line segment until all line segments are calculated.

[0148] Step 2: Based on all the segmented line segments, the line segments with the same vertices are grouped together, and only one line segment with the same two endpoints is retained.

[0149] Step 3: Based on Step 2, project all vertices onto the X-axis. Based on the projected points, select two adjacent points with the largest distance on the X-axis. Draw a straight line perpendicular to the X-axis through the midpoint of the coordinates of the two adjacent points on the X-axis. See Fig.14 , two adjacent points are x1 and x2, the midpoint c = (x1 + x2) / 2, then the line perpendicular to the X-axis is L2;

[0150] Step 4. Get the minimum Y-axis coordinate of the intersection of line L2 and all line segments in line segment set Set'. Fig.14 Ymin in;

[0151] Step 5. Take the line segment with the smallest Y-axis coordinate value as the starting line segment of the outer contour line, and take the vertex at one end of the line segment as the starting point pstart and the vertex at the other end as the end point pend;

[0152] Step 6. Traverse all the line segments in the line segment set Set' whose vertices have the same coordinate values ​​as the end point pend of the starting line segment, select the line segment with the largest angle with the starting line segment as the new starting line segment, and take the other end vertex of the new starting line segment as the new end point pend. Iterate Step 6 until the coordinates of the new end point pend are equal to the coordinates of the starting point pstart. The iteration ends, and all the found line segments are taken as the outer contour lines. The vertices of the outer contour lines form a sequence W = {p1, p2, p3, ..., pN}, so as to determine the line segments and vertices of the outer contour line.

[0153] Step 5: Determine the installation plane according to at least one of the pin bounding box and the body bounding box, and the pin type, and move the local coordinate system to the installation plane.

[0154] Generally speaking, for components, the mounting surface is at the bottom of the component pin or the bottom of the body. In the local coordinate system LocalCsys, select the following steps corresponding to the shape type according to the shape type of the pin to calculate the z coordinate value zCoord of the component mounting plane. The calculation process is as follows:

[0155] If the pin type is a mounting pin, such as J2, J6, J8, and J10, the component mounting plane is at the bottom of the pin, and the bounding box Jpinbox of all pins is calculated, that is, zCoord = Jpinbox.minPnt.z, where Jpinbox.minPnt.z is the z coordinate value of the minimum point minPnt of the bounding box Jpinbox.

[0156] If the shape type of the pin is a plug-in pin, such as J14, the component mounting plane is at the bottom of the body, and the bounding box LocalbodyBox of all bodies is calculated, that is, zCoord = LocalbodyBox.minPnt.z, LocalbodyBox.minPnt.z is the z coordinate value of the minimum point minPnt of the bounding box LocalbodyBox.

[0157] After the above calculation of the component installation plane is completed, the local coordinate system LocalCsys is moved to the installation plane.

[0158] In addition, in practice, there are situations where the pin shape type is a combination of multiple pins (i.e., there are multiple types of pins on one body). In this case, the priority order of determining the installation plane of the combination pins based on the pin type is as follows: surface mount pin type > plug-in pin type. For example, the pin shape type includes both J6 and J14. According to the above priority, J6 is better than J14, so the component installation plane corresponding to the J6 type pin is selected as the corresponding installation plane in the above multiple pin combinations.

[0159] Step 6: Get the size of the body based on the shape of the body and the bounding box of the body.

[0160] like Figure 4 As shown, in the local coordinate system LocalCsys, according to the body shape calculated in the above steps, for each body, the size information corresponding to each body is calculated in turn. Specifically, when the body shape is a cube, execute the following step 6.1; when the body shape is a cylinder, execute the following step 6.2; when the body shape is a polygon, execute the following step 6.3.

[0161] 6.1 Calculate the length, width, height and center point of the cube.

[0162] Specifically, in the local coordinate system LocalCsys, the bounding box cubeBox of the body is calculated, and the length, width, height and center point of the cube body are determined according to the coordinates of the bounding box cubeBox, and the calculation result is returned.

[0163] 6.2 Calculate the radius, height and center point of the cylinder body.

[0164] In the local coordinate system LocalCsys, calculate the bounding box cylinderBox of the body, calculate the length d1, d2, d3 of the bounding box cylinderBox in the X, Y, and Z directions, determine the radius, height, and center point of the cylinder body based on the relationship between d1, d2, and d3, and return the calculation result.

[0165] 6.3 Calculate the height, contour point set and center point of the polygon body.

[0166] The first step is to obtain the outer contour point sets Wx, Wy, and Wz of the projected shape of the body in the X, Y, and Z directions respectively, and extract the areas Sx, Sy, and Sz of the outer contour after projection in the three directions;

[0167] The second step is to calculate the bounding box polygonBox of the main body in the local coordinate system LocalCsys, calculate the coordinates of the center point of the main body according to the coordinates of the bounding box polygonBox, and calculate the approximate volumes Mx, My, and Mz based on the coordinates of the bounding box polygonBox and the above Sx, Sy, and Sz, where:

[0168] Mx=Sx*(polygonBox.maxPnt.x-polygonBox.minPnt.x)

[0169] My=Sy*(polygonBox.maxPnt.y-polygonBox.minPnt.y)

[0170] Mz=Sz*(polygonBox.maxPnt.z-polygonBox.minPnt.z)

[0171] Wherein, polygonBox.maxPnt.x, polygonBox.maxPnt.y and polygonBox.maxPnt.z respectively represent the x, y and z coordinate values ​​of the maximum point maxPnt of the bounding box polygonBox, and polygonBox.minPnt.x, polygonBox.minPnt.y and polygonBox.minPnt.z respectively represent the x, y and z coordinate values ​​of the minimum point minPnt of the bounding box polygonBox.

[0172] The projection shape in the direction with the smallest volume among Mx, My and Mz is closest to the true shape of the body, so the height and contour point set of the polygonal body can be determined. For example, Mx≤My and Mx≤Mz, that is, the projection shape in the X direction is closest to the true shape of the body, Wx is the required contour point set, and the height H = polygonBox.maxPnt.x-polygonBox.minPnt.x. When My or Mz is the smallest, the calculation method is the same as that of Wx, and no further details are given here.

[0173] Step 7: Calculate all through holes on the body that are parallel to the preset axis of the local coordinate system.

[0174] Specifically, in the local coordinate system LocalCsys, for all bodies, the through holes on all bodies parallel to the preset axis of the coordinate system LocalCsys are calculated (the through holes have three cross-sectional shapes: rectangular, circular, and polygonal, for example Fig.15 shown).

[0175] In a specific embodiment, step 7 may include steps 7.1 to 7.4, wherein:

[0176] Step 7.1, based on the local coordinate system, project all entities along the preset axis direction of the local coordinate system to obtain the first line segment set Set' after the projection of all entities. Refer to the "method for obtaining the vertices of the outer contour line of the line segment set Set'" in the above step 4.26 to obtain the outer contour line in the first line segment set Set'. The preset axis is, for example, the Z axis.

[0177] Step 7.2, delete the outer contour lines in the first line segment set Set” to obtain the second line segment set Set”.

[0178] Specifically, since the first line segment set Set'' includes outer contour lines, the second line segment set Set'' can be obtained by deleting the outer contour lines in the first line segment set Set''.

[0179] Step 7.3, delete the projection line segments that do not penetrate the body in the second line segment set Set” to obtain the third line segment set Set”.

[0180] Specifically, loop through each line segment in the second line segment set "Set" in turn, make two straight lines with the two end points of the line segment, and the directions of the two straight lines are parallel to the Z-axis direction of the coordinate system, obtain the intersection points of the two straight lines with all the faces of the entity, and among all the intersection points, as long as any one of the intersection points is not on the contour line of the face, delete this line segment in the second line segment set "Set", otherwise (all intersection points are on the contour line of the face) continue to calculate the next line segment until all the line segments in the second line segment set "Set" are calculated, and obtain the third line segment set "Set".

[0181] Step 7.4, select the end-to-end connected line segments from the third line segment set Set' to obtain a fourth line segment set Set', wherein the fourth line segment set Set' includes the cross-sectional shapes of several through holes.

[0182] Specifically, loop through each line segment in the third line segment set "Set" in turn, and according to the principle that line segments are connected end to end, if there is a line segment connected to both ends of the line segment and its endpoints, continue to calculate the next line segment, otherwise (at least one end of the line segment is not connected to any line segment), delete this line segment in the third line segment set "Set". Iterate this step, if the number of remaining line segments in the third line segment set "Set" is zero, it means that there is no through hole on the body, and the execution ends; otherwise, until all the line segments are connected end to end, the fourth line segment set "Set" is obtained.

[0183] According to the principle that the line segments are connected end to end, all the remaining line segments in the fourth line segment set "Set" are divided into M subsets, ensuring that all the line segments in each subset are connected end to end in sequence, so that each subset constitutes an inner contour, and each inner contour represents the cross-sectional shape of a through hole, forming a cross-sectional set sequence S cross-sectional = {S1, S2, ..., SM}.

[0184] After that, the cross-sectional shape of each through hole can be calculated in turn. The specific calculation process is as follows:

[0185] The cross-sectional shape of each through hole in the cross-sectional set sequence S is determined by a projection shape determination method, and the result is a rectangle, a circle or a polygon.

[0186] 1) If the cross-sectional shape of the through hole is a rectangle, calculate the cross-sectional length, width, and center point of the rectangular through hole according to the coordinates of the rectangular bounding box, and return the calculation result.

[0187] 2) If the cross-sectional shape of the through hole is circular, calculate the cross-sectional center and radius of the circular through hole based on the minimum circumscribed circle and return the calculation result.

[0188] 3) If the cross-sectional shape of the through hole is a polygon, the cross-sectional center point of the polygonal through hole is calculated according to the coordinates of the rectangular bounding box. The contour points can be obtained according to the end points of the line segments connected at the beginning and the end in the cross-sectional subset, and the calculation results are returned.

[0189] Step 8: Obtain the size of the pin based on the shape of the pin, the shape type of the pin, and the bounding box of the pin.

[0190] In the local coordinate system LocalCsys, according to the pin shape and shape type calculated in the above steps, the size information of each pin is calculated in turn, that is, the driving size of each pin is calculated. When the driving size of each pin is determined, the corresponding pin model can be automatically generated. For different pin types, the size of each pin can be determined according to the above content. This embodiment uses J2, J6, J8, J10, and J14 as examples for explanation. The calculation method of the size of other types of pins can be calculated according to the specific pins by referring to the above content. This embodiment will not repeat other pin types.

[0191] 8.1 The pin shape type is J2, such as Fig. 9 As shown:

[0192] The first step is to calculate the pin's bounding box J2Box in the local coordinate system LocalCsys.

[0193] The second step is to calculate the dimensions B, A, C and center point coordinates of the J2 pin based on the bounding box J2Box.

[0194] Specifically, size B = J2Box.maxPnt.x-J2Box.minPnt.x, size A = J2Box.maxPnt.y-J2Box.minPnt.y, size C = J2Box.maxPnt.z-J2Box.minPnt.z, center point Center = ((J2Box.minPnt.x+J2Box.maxPnt.x) / 2, (J2Box.minPnt.y+J2Box.maxPnt.y) / 2, ( J2Box.minPnt.x+J2Box.maxPnt.z) / 2), where J2Box.minPnt.x, J2Box.minPnt.y and J2Box.minPnt.z respectively represent the x, y and z coordinate values ​​of the minimum point minPnt of the bounding box J2Box, and J2Box.maxPnt.x, J2Box.maxPnt.y and J2Box.maxPnt.z respectively represent the x, y and z coordinate values ​​of the maximum point maxPnt of the bounding box J2Box.

[0195] 8.2 The pin shape type is J6, such as Fig.10 As shown:

[0196] The first step is that the J6 pins are usually distributed around the body, such as Figure 5 As shown, the local coordinate system localCsys is adjusted accordingly to match the pin posture.

[0197] The second step is to calculate the pin's bounding box J6Box in the latest local coordinate system LocalCsys (after adjustment in the above steps).

[0198] The third step is Fig.16 As shown, based on the bounding box J6Box, the dimensions A, D and center point coordinates of the J6 pin are calculated.

[0199] Specifically, the size A = J6Box.maxPnt.x–J6Box.minPnt.x, and the size D of the J6 pin = J6Box.maxPnt.z–J6Box.minPnt.z, wherein J6Box.minPnt.x and J6Box.minPnt.z respectively represent the x and z coordinate values ​​of the minimum point minPnt of the bounding box J6Box, and J6Box.maxPnt.x and J6Box.maxPnt.z respectively represent the x and z coordinate values ​​of the maximum point maxPnt of the bounding box J6Box.

[0200] Step 4: Traverse all planes whose normal vectors of the J6 pin are parallel to the Z axis of the coordinate system, and obtain the plane at the bottom in the Z direction (looking from the positive direction of the Z axis to the negative direction) as the bottom face bottomFace of the J6 pin. Calculate the bounding box bottomBox of the bottom face bottomFace, and calculate the size B of the J6 pin based on the bounding box bottomBox, that is, size B = bottomBox.maxPnt.y-bottomBox.minPnt.y, where bottomBox.minPnt.y and bottomBox.maxPnt.y represent the minimum y coordinate and maximum y coordinate of the bounding box bottomBox respectively.

[0201] Step 5. Find the nearest antiparallel plane (parallel plane with opposite normal vectors) based on the bottom plane bottomFace in the above step, and take the normal distance between the two planes as the dimension C of the J6 pin.

[0202] The sixth step is to restore the local coordinate system LocalCsys to the posture before the first step, and convert the center point calculated in the third step to the local coordinate system LocalCsys at this time.

[0203] 8.3 The pin shape type is J8, such as Fig.11 As shown:

[0204] The first step is that the J8 pins are usually distributed around the body, such as Figure 6 As shown, the local coordinate system localCsys is adjusted accordingly to match the pin posture.

[0205] The second step is to calculate the pin's bounding box J8Box in the latest local coordinate system LocalCsys (after adjustment in the above steps).

[0206] The third step is Fig.11As shown, all faces of the J8 pin are traversed in turn, and the minimum coordinate value J8minPnt of each face is obtained. If the minimum z coordinate value of the face is equal to the minimum z coordinate value of the bounding box J8Box, this face is added to the sequence set faceList until all faces of the J8 pin are calculated. After that, the bounding box J8minBox (rectangular shape) of all faces in the sequence set faceList is calculated, as shown Fig.17 As shown, the dimensions A, A1, D and center point coordinates of the J8 pin are calculated according to the coordinates of J8minBox and J8Box. The dimension B of the J8 pin takes the default value B=Kb*A. The dimension B of the above pin is a certain multiple of the pin dimension A. Kb can be adjusted according to the actual situation. The preferred value of Kb is 3.0.

[0207] Among them, size A = J8minBox.maxPnt.x–J8minBox.minPnt.x, size A1 = J8Box.maxPnt.x–J8Box.minPnt.x, size D = J8Box.maxPnt.z–J8Box.minPnt.z, J8minBox.minPnt.x and J8minBox.maxPnt.x respectively represent the minimum and maximum x coordinates of the bounding box J8minBox, and J8Box.minPnt.x, J8Box.minPnt.z, J8Box.maxPnt.x and J8Box.maxPnt.z respectively represent the minimum x, z coordinates and maximum x, z coordinates of the bounding box J8Box.

[0208] In the fourth step, the dimension C can be obtained according to the distance between two vertical auxiliary lines in the contour feature used in the pin type determination process of this pin, that is, the dimension C is equal to the distance between the two vertical auxiliary lines.

[0209] The fifth step is to restore the local coordinate system LocalCsys to the posture before the first step, and convert the center point calculated in the third step to the local coordinate system LocalCsys at this time.

[0210] In this embodiment, for the J6 pin and the J8 pin, the process of adjusting the local coordinate system localCsys to match the pin posture is as follows:

[0211] 1) If Figure 5 and Figure 6As shown in the figure, in the top view of the component, the pins are divided into the corresponding areas according to the principle of the shortest distance between the pin boundary and the body boundary. Specifically, in the top view, when the pin is closest to the right boundary of the body, the pin belongs to the first area; when the pin is closest to the lower boundary of the body, the pin belongs to the second area; when the pin is closest to the left boundary of the body, the pin belongs to the third area; when the pin is closest to the upper boundary of the body, the pin belongs to the fourth area; when the pin boundary intersects with the boundaries of the body in the three directions of the upper, lower, left and right, among the three directions, the area in the middle direction is selected as the area to which the pin belongs. For example, when the pin boundary intersects with the boundaries of the body in the three directions of the upper, lower and left, the third area is selected as the area to which the pin belongs.

[0212] 2) According to the area to which the pin belongs, the local coordinate system is transformed accordingly to adapt it to the spatial position of the pin. The specific rules are as follows. The rotation direction is reversible. The following takes counterclockwise as an example:

[0213] If the pin belongs to the first area, the X-axis of the local coordinate system LocalCsys rotates 90° counterclockwise around the Z-axis of the local coordinate system LocalCsys (looking from the positive direction of the Z-axis to the negative direction of the Z-axis).

[0214] If the pin belongs to region II, the local coordinate system LocalCsys remains unchanged.

[0215] If the pin belongs to region III, the X-axis of the local coordinate system LocalCsys rotates 270° counterclockwise around the Z-axis of the local coordinate system LocalCsys (looking from the positive direction of the Z-axis to the negative direction of the Z-axis).

[0216] If the pin belongs to the IV region, the X-axis of the local coordinate system LocalCsys rotates 180° counterclockwise around the Z-axis of the local coordinate system LocalCsys (looking from the positive direction of the Z-axis to the negative direction of the Z-axis).

[0217] 8.4 The pin shape type is J10, such as Fig.12 As shown:

[0218] The first step is to calculate the pin's bounding box J10Box in the local coordinate system LocalCsys.

[0219] The second step is, Fig.18 As shown, according to the bounding box J10Box, the size A and the center point coordinates of the J10 pin are calculated, and the size A = J10Box.maxPnt.x - J10Box.minPnt.x, and J10Box.minPnt.x and J10Box.maxPnt.x represent the minimum x coordinate and the maximum x coordinate of the bounding box J10Box respectively.

[0220] 8.5 The pin shape type is J14, and the pin size information of the shape is a cube, such as Fig.13 As shown:

[0221] The first step is to calculate the bounding box J14Box1 of the rectangular pin in the local coordinate system LocalCsys.

[0222] The second step is, Fig.13 As shown, the dimensions A, B, C and center point coordinates of the J14 rectangular pin are calculated based on the bounding box J14Box1.

[0223] Specifically, size A = J14Box1.maxPnt.x–J14Box1.minPnt.x, size B = J14Box1.maxPnt.y–J14Box1.minPnt.y, size C = J14Box1.maxPnt.z–J14Box1.minPnt.z, J14Box1.minPnt.x, J14Box1.minPnt.y and J14Box1.minPnt.z respectively represent the x, y and z coordinate values ​​of the minimum point minPnt of the bounding box J14Box1, J14Box1.maxPnt.x, J14Box1.maxPnt.y and J14Box1.maxPnt.z respectively represent the x, y and z coordinate values ​​of the maximum point maxPnt of the bounding box J14Box1.

[0224] 8.6 The pin shape type is J14, and the pin size information of the shape is cylindrical, such as Fig.13 As shown:

[0225] The first step is to calculate the bounding box J14Box2 of the circular pin in the local coordinate system LocalCsys.

[0226] The second step is, Fig.13 As shown, the dimensions A, C and center point coordinates of the J14 circular pin are calculated according to the bounding box J14Box2, dimension A = J14Box2.maxPnt.x–J14Box2.minPnt.x, dimension C = J14Box2.maxPnt.z–J14Box2.minPnt.z, J14Box2.minPnt.x and J14Box2.minPnt.z respectively represent the x and z coordinate values ​​of the minimum point minPnt of the bounding box J14Box2, and J14Box2.maxPnt.x and J14Box2.maxPnt.z respectively represent the x and z coordinate values ​​of the maximum point maxPnt of the bounding box J14Box2.

[0227] 8.7 The pin shape type is J14, and the pin size information of the shape is a polygon, such as Fig.13 As shown:

[0228] The first step is to calculate the bounding box J14Box3 of the polygon pin in the local coordinate system LocalCsys.

[0229] The second step is, Fig.13 As shown, the size C and center point coordinates of the J14 polygon pin are calculated according to the bounding box J14Box3, and the contour point set W can be obtained according to the result Sz of the projection in the Z-axis direction. The size C = J14Box3.maxPnt.z-J14Box3.minPnt.z, J14Box3.minPnt.z and J14Box3.maxPnt.z respectively represent the z coordinate value of the minimum point minPnt and the maximum point maxPnt of the bounding box J14Box3.

[0230] Step 9: Assign attributes.

[0231] Step 9.1. Assign attribute values ​​to the model as a whole, such as package name, package type, manufacturer, material number, quality, power consumption, and moisture sensitivity level.

[0232] Step 9.2: Assign attribute values ​​to the entity, such as color, material, and manufacturing tolerance.

[0233] Step 9.3: Assign attribute values ​​to the pins, such as color, material, installation type, electrical properties, and manufacturing tolerances.

[0234] Step 10: Output parameterized model data.

[0235] Specifically, the corresponding format file including the model and model parameters is output according to the requirements, such as the STEP format file required for CAD modeling, the data file required for the component library, etc. The model parameters include but are not limited to: the shape of the output body, and / or the shape type of the pin, and / or the size of the body, and / or the center point coordinates of the body, and / or the size of the pin, and / or the center point coordinates of the pin, and / or the shape of the through hole, and / or the radius of the through hole, and / or the center point coordinates of the through hole, etc.

[0236] Compared with the previous manually simplified models, the method of the present invention can automatically output simplified model files, and the component bodies and pins are highly distinguished, with less manual intervention, which greatly reduces the workload of modelers and effectively improves the calculation speed of model analysis and simulation software, as well as the accuracy of the results.

[0237] The coordinate axes involved in this solution are preferred examples. In practice, the orientation of the coordinate axes can be adjusted and transformed according to specific circumstances. The preset axes, X-axis, Y-axis, and Z-axis in this solution are not limited to uniqueness.

[0238] Embodiment 2

[0239] This embodiment further provides a specific component modeling and parameterization method based on the above embodiment, and the component modeling and parameterization method includes:

[0240] S1. Read the mechanical 3D CAD design file VY-1024.step. The component model corresponding to this file is as shown in the attached Fig.15 shown.

[0241] S2. Obtain model data from the above mechanical 3D CAD design file. The model data includes:

[0242] Model type: part; name of component: VY-1024; absolute coordinate system WorldCsys (origin is (0.0,0.0,0.0), X-axis direction vector is (1.0,0.0,0.0), Y-axis direction vector is (0.0,1.0,0.0), Z-axis direction vector is (0.0,0.0,1.0)); geometric data of points, lines and surfaces and color information: coordinates of all points, lines and surfaces in the model, vectors of lines, normal vectors of surfaces and corresponding colors (including black and gray) and other data.

[0243] S3, model splitting and clustering

[0244] S3.1. For the model, all its faces are grouped by color to obtain 2 groups.

[0245] S3.2. Divide all the faces in each group into 7 subgroups based on the principle of connecting the outer contours.

[0246] S3.3. Calculate bounding boxes for all subgroups, sort them according to the bounding boxes, and remove duplicates.

[0247] In the first step, based on the point, line and surface geometric data in the above model data and according to the above method of calculating the bounding box, the bounding box of each subgroup is calculated in turn as follows:

[0248] box1(minPnt(8.85,3.8,5),maxPnt(9.25,4.4,5.9)),

[0249] box2(minPnt(9.8,1.6,5),maxPnt(10.2,2.2,5.9)),

[0250] box3(minPnt(10.75,1.6,5),maxPnt(11.15,2.2,5.9)),

[0251] box4(minPnt(8.85,1.6,5),maxPnt(9.25,2.2,5.9)),

[0252] box5(minPnt(10.75,3.8,5),maxPnt(11.15,4.4,5.9)),

[0253] box6(minPnt(10.95,3.4,5.1),maxPnt(11.15,3.6,6.1)),

[0254] box7(minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1)).

[0255] The second step is to sort by bounding box. Calculate the length, width, and height of each subgroup's bounding box. Take bounding box box1 as an example: length Lbox1 = 9.25-8.85 = 0.4, width Wbox1 = 4.4-3.8 = 0.6, height Hbox1 = 5.9-5 = 0.9, volume Vbox1 = 0.4 × 0.6 × 0.9 = 0.216. Similarly, the calculation of the bounding box volume of the remaining subgroups is the same.

[0256] In this embodiment, Vbox1 = Vbox2 = Vbox3 = Vbox4 = Vbox5 = 0.216, Vbox6 = 0.04, Vbox7 = 4.64. All subgroups are sorted from large to small according to the bounding box volume to form a sequence set List = {box7: subgroup 7, box1: subgroup 1, box2: subgroup 2, box3: subgroup 3, box4: subgroup 4, box5: subgroup 5, box6: subgroup 6}.

[0257] The third step is to remove duplicate bounding boxes. Combining the bounding box coordinates of the above subgroups and the above bounding box removal calculation method, we can know that the minimum xyz coordinate value of box7 (8.55, 2.2, 5.1) is less than or equal to the minimum xyz coordinate value of box6 (10.95, 3.4, 5.1), and the maximum xyz coordinate value of box7 (11.45, 3.8, 6.1) is greater than or equal to the maximum xyz coordinate value of box6 (11.15, 3.6, 6.1), that is, box7 completely contains box6, and delete the element (box6: subgroup 6) in the sequence set List.

[0258] S4. Distinguish between component body and pins

[0259] Among the remaining 6 subgroups above, the first element subgroup 7 in the sequence set List is taken as the body, Vmax=Vbox7=4.64, and the last element subgroup 5 in the sequence set List is taken as the pin, Vmin=Vbox5=0.216. The calculation process of the remaining subgroups is as follows: Taking subgroup 1 as an example, r1=Vbox1 / Vmax=0.216 / 4.64=0.047, r2=Vmin / Vbox1=0.216 / 0.216=1.0, because r2>r1, so subgroup 1 is the pin.

[0260] Similarly, all remaining subgroups are distinguished according to the above method, and finally a body sequence set BodyList = {box7: subgroup 7} (this embodiment is illustrated by taking only one body as an example), and a pin sequence set PinList = {box1: subgroup 1, box2: subgroup 2, box3: subgroup 3, box4: subgroup 4, box5: subgroup 5} is formed.

[0261] S5. Body shape determination

[0262] S5.1. Create a local coordinate system LocalCsys and adjust the Z-axis direction of the coordinate system LocalCsys.

[0263] In the first step, take Origin = (0.0, 0.0, 0.0) as the origin, Vx = (1.0, 0.0, 0.0), Vy = (0.0, 1.0, 0.0), Vz = (0.0, 0.0, 1.0) as the direction vectors of the X, Y, and Z axes of the local coordinate system LocalCsys. At this time, the local coordinate system LocalCsys completely overlaps with the absolute coordinate system WorldCsys.

[0264] The second step is to obtain the bounding box of all entities in the absolute coordinate system WorldCsys according to step S4: BodyListBox(minPnt(8.55,2.2,5.1), maxPnt(11.45,3.8,6.1)), the center point of all entities: BodyListCenter = ((8.55+11.45) / 2, (2.2+3.8) / 2, (5.1+6.1) / 2) = (10.0,3.0,5.6); obtain the bounding box of all entities according to step S4: The bounding box of the foot is PinListBox (minPnt(8.85,1.6,5.0), maxPnt(11.15,4.4,5.9)), the center point of all pins is PinListCenter = ((8.85+11.15) / 2, (1.6+4.4) / 2, (5.0+5.9) / 2) = (10.0,3.0,5.45), and the vector zV pointing from the center of all pins to the center of all bodies is (0.0,0.0,0.15).

[0265] The third step is to determine whether all pins overlap in the coordinate axes X, Y, and Z directions according to the pin bounding box obtained in step S4.

[0266] The principle for judging whether the bounding boxes overlap along the coordinate axis direction is as follows: when judging whether the bounding boxes overlap in a certain direction of the coordinate axis, if the projections of the bounding boxes on the remaining two coordinate axes overlap, it means that the bounding boxes overlap in this direction, otherwise the bounding boxes do not overlap in this direction.

[0267] The principle for judging whether the projections of the bounding boxes on the coordinate axis overlap is as follows: take the larger value C1 of the coordinate values ​​of the two minimum points of the two bounding boxes corresponding to this coordinate axis, and take the smaller value C2 of the coordinate values ​​of the two maximum points of the two bounding boxes corresponding to this coordinate axis. If C1 ≥ C2, the projections of the two bounding boxes on this coordinate axis do not overlap, otherwise the projections of the two bounding boxes on this coordinate axis overlap.

[0268] Take judging whether the bounding boxes box1 and box5 overlap in the X-axis direction as an example: take the larger value C1=box5.minPnt.x=10.75 of the coordinate values ​​box1.minPnt.x and box5.minPnt.x of the two minimum points of the two bounding boxes corresponding to the X-axis, and take the smaller value C2=box1.maxPnt.x=9.25 of the coordinate values ​​box1.maxPnt.x and box5.maxPnt.x of the two maximum points of the two bounding boxes corresponding to the X-axis. Because C1>C2, the projections of the bounding boxes box1 and box5 on the X-axis do not overlap. Similarly, the projections of the bounding boxes box1 and box5 on the Y-axis overlap, and the projections on the Z-axis overlap, so the bounding boxes box1 and box5 overlap along the X-axis.

[0269] Similarly, box2, box3, and box4 overlap in the X direction of the coordinate axis, box1 and box4 overlap in the Y direction of the coordinate axis, and box3 and box5 overlap in the Y direction of the coordinate axis. All pins have no overlap in the Z direction of the coordinate axis. The coordinate value of the vector zV corresponding to the non-overlapping direction (Z direction of the coordinate axis) is added to the sequence set Vlist, and Vlist = {0.15} is obtained.

[0270] The fourth step is to take the direction (0.0, 0.0, 1.0) corresponding to the first coordinate value 0.15 in the sequence set Vlist as the direction of the Z axis of the local coordinate system, and the vector zV.z>0, that is, 0.15>0. The Z axis direction of the local coordinate system LocalCsys is the same as the z axis direction corresponding to the absolute coordinate system WorldCsys.

[0271] S5.2. Calculate the shape of the ontology in the ontology sequence set BodyList.

[0272] The body represented by subgroup 7 is projected along the coordinate axes X, Y, and Z of the local coordinate system LocalCsys, and three first projection shapes after projection are calculated according to the following method.

[0273] Calculation of the body projection shape (taking Z-direction projection as an example):

[0274] The first step is to discretize the curve. Traverse all the edges of the body. If it is a straight line, no discretization is required; if it is a curve, discretize all the edges according to the discretization interval (for example, one tenth of the length) to obtain the line segment set Set = {seg{end1(11.45,2.306,5.1),end2(11.45,3.694,5.1)}, ... seg{end1(8.55,2.236,6.1),end2(8.55,3.764,6.1)}};

[0275] The second step is to project the line segments in the line segment set Set along the coordinate axis Z axis to the coordinate system XOY plane in sequence, and obtain the projected line segment set Set' = {seg'{end1(11.45,2.306,0.0),end2(11.45,3.694,0.0)}, ..., seg'{end1(8.55,2.236,0.0),end2(8.55,3.764,0.0)}};

[0276] The third step is to calculate the vertex set W of the outer contour of the line segment set Set', refer to Fig.14 .

[0277] 1) Calculate whether each line segment in the line segment set Set' intersects with all other line segments in turn (when the line segments overlap, the endpoints of the overlapping parts are regarded as two intersection points). If there is an intersection and the intersection point is not at the endpoint of the line segment, the line segment is split from the intersection point. Otherwise (no intersection point, or there is an intersection point and the intersection point is at the endpoint of the line segment), continue to calculate the next line segment. Take the two line segments in the line segment set Set' as an example: the intersection point of line segment seg1'{end1(11.45,3.764,0.0),end2(11.45,3.8,0.0)} and line segment seg2'{end1(11.45,3.8,0.0),end2(11.45,3.694,0.0)} is P 交点1 (11.45,3.8,0.0) and P 交点2 (11.45,3.694,0.0),P 交点1 At the endpoint of line segment seg1' without segmentation, P 交点2Split the line segment seg1' into two line segments seg11'{end1(11.45,3.764,0.0),end2(11.45,3.694,0.0)} and seg12'{end1(11.45,3.8,0.0),end2(11.45,3.694,0.0)}, and repeat the same process until all line segments are calculated.

[0278] 2) Group all line segments in the segmented line segment set Set' by vertex, group line segments with the same vertex into one group, and keep only one line segment with the same two endpoints. For example, line segments seg11' and seg12' are grouped into the same group if they have the same endpoints.

[0279] 3) Take the X coordinate values ​​of the two points with the largest distance between all vertices on the X axis, x1=8.55 and x2=10.95, and use the midpoint of the two coordinate values ​​c=(x1+x2) / 2=9.75 to make a straight line L2 perpendicular to the X axis: x=9.75, and obtain the minimum Y coordinate value 2.2 of the intersection of the straight line L2 and all the line segments in the line segment set. The line segment corresponding to the minimum value is segYmin{end1(8.55,2.2,0.0), end2(11.45,2.2,0.0)}, and use the endpoint segYmin.end1 as the starting point pstart and segYmin.end2 as the end point pend;

[0280] 4) Traverse all line segments in the line segment set Set' whose line segment vertices have the same coordinate values ​​as the end point pend, take the line segment with the largest angle with the starting line segment as the new starting line segment, and take the other end vertex of the new starting line segment as the new end point pend. Iterate this step until the new end point coordinate pend is equal to the starting point coordinate pstart. The iteration ends, and all the found line segments are taken as the outer contour lines. The contour line vertices are taken to form a sequence W = {p(8.55,2.2,0.0), p(11.45,2.2,0.0), ... p(8.55,2.236,0.0)}.

[0281] Step 4: Get the contour area S = 4.64 of the outer contour line of the line segment set Set', and get the rectangular bounding box R of the outer contour vertex set W respectively. 矩形 The area S 矩形 =4.64 and the minimum circumscribed circle C 外接圆 The area S 圆 =8.62, calculate the outer contour area S and rectangle R respectively 矩形 , circumscribed circle C 外接圆 The ratio of the areas, r 矩形 =S / S 矩形 =4.64 / 4.64=1.0, r 圆 =S / S圆 =4.64 / 8.62=0.54. In this embodiment, K and K1 are 0.85 and 0.9 respectively. 矩形 >r 圆 And r 矩形 >0.85, so the first projection shape of the body in the Z direction is determined to be a rectangle.

[0282] Similarly, the first projection shapes of the body represented by subgroup 7 in the X and Y directions are calculated according to a similar method, and it is found that the first projection shapes in the X and Y directions are both rectangles, that is, the first projection shapes of the body represented by subgroup 7 in three directions are all rectangles, so this body is a cube.

[0283] S6. Pin shape type identification

[0284] S6.1. Calculate the shape of the pin

[0285] Calculate the shape of each pin in the pin sequence set PinList in turn. Taking the pin represented by subgroup 1 as an example, the calculation process is as follows:

[0286] In the local coordinate system LocalCsys, the pin is projected along the coordinate axes X, Y, and Z, and the three second projection shapes Sx, Sy, and Sz after projection are calculated respectively. The calculation method is the same as the calculation method of the first projection shape of the main body in step 5.2. The second projection shapes Sx, Sy, and Sz after projection are polygonal, rectangular, and rectangular, respectively. Therefore, the shape of this pin is a polygon.

[0287] Similarly, according to a similar method, all other pins can be obtained as polygons.

[0288] S6.2. In the local coordinate system LocalCsys, calculate the local features, distribution features and contour features of each pin, taking the pin represented by subgroup 1 as an example:

[0289] 1) Local features.

[0290] The first step is to obtain the bounding boxes of all entities:

[0291] LocalBodyListBox(minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1)) and the bounding box of the above pin LocalPinBox(minPnt(8.85,3.8,5.0),maxPnt(9.25,4.4,5.9)).

[0292] The second step is to calculate the bounding box overlap.

[0293] Take the coordinate axis X as an example: take the larger value of LocalBodyListBox.minPnt.x and LocalPinBox.minPnt.x as X1=8.85, take the smaller value of LocalBodyListBox.maxPnt.x and LocalPinBox.maxPnt.x as X2=9.25, and get the overlapping length overLen=X2–X1=9.25–8.85=0.4, the overlap of the body on the X-axis is overLen / (LocalBodyListBox.maxPnt.x-LocalBodyListBox.minPnt.x)=0.4 / (11.45–8.55)=13.8%, and the overlap of the pin on the X-axis is overLen / (LocalPinBox.maxPnt.x-LocalPinBox.minPnt.x)=0.4 / (9.25–8.85)=100%. Similarly, the overlap of the body on the Y axis is 0, and the overlap of the pins on the Y axis is 0; the overlap of the body on the Z axis is 80%, and the overlap of the pins on the Z axis is 88.9%.

[0294] 2) Distribution characteristics. According to the Z-projection outer contour of the body calculated in step 5.2 and the Z-projection outer contour of the pin calculated in step 6.1, according to the existing algorithm for judging whether the points are inside or outside the polygon, it can be judged that some of the outer contour points of the pin are on the outer contour line of the body, and all the remaining outer contour points of the pin are outside the outer contour line of the body. Figure 5 As shown, the pins are outside the outer contour of the body.

[0295] 3) Contour features. For the three projections of the pin, according to the above contour feature calculation method, the areas where all the vertices of the projection shape of the pin outside the two vertical auxiliary lines are located are determined in turn: the projections Sx and Sy of the pin along the Y and Z directions of the coordinate axis are rectangular, all the vertices are between the two vertical auxiliary lines, and the corresponding contour features are empty; the projection Sz of the pin along the X direction of the coordinate axis is a polygon, all the vertices outside the two vertical auxiliary lines are Figure 7 The ① and ③ areas in it.

[0296] Similarly, the local features, distribution features and contour features of all other pins can be calculated.

[0297] S6.3. Pin shape type recognition based on multi-feature fusion method

[0298] Taking the pins represented by subgroup 1 as an example, the shape type of the pins is distinguished according to the shape, and / or distribution characteristics, and / or local characteristics, and / or contour characteristics of the pins, and the relevant characteristics are as follows:

[0299] 1) Distribution characteristics: In the top view, the pins are outside the outer contour of the body and are connected;

[0300] 2) Pin shape: The pin is a polygon;

[0301] 3) Contour feature: The projection shape Sx of the pin along the coordinate axis X direction satisfies that all vertices outside its two vertical auxiliary lines are in areas ① and ③.

[0302] The pin meets the criteria for the J6 pin, so it is determined to be a J6 type pin.

[0303] Similarly, it can be determined that the remaining pin types are all J6.

[0304] S7. Calculate the component installation plane

[0305] For components with mounting pins of pin type J6, the component mounting plane is at the bottom of the pin. Get the bounding box LocalPinListBox(minPnt(8.85,1.6,5.0),maxPnt(11.15,4.4,5.9)) of all pins in the local coordinate system LocalCsys. The z coordinate value of the component mounting plane is zCoord=LocalPinListBox.minPnt.z=5.0.

[0306] From the above calculation, we can get a point pcbPnt=(0.0,0.0,zCoord) on the installation plane. Convert the point pcbPnt to the absolute coordinate system WorldCsys and get the corresponding point pcbPnt'=(0.0,0.0,5.0) in the absolute coordinate system WorldCsys.

[0307] Move the above-mentioned local coordinate system LocalCsys to the installation plane, the origin Origin of the local coordinate system LocalCsys = pcbPnt' = (0.0, 0.0, 5.0), and the X, Y, Z coordinate axis directions Vx, Vy, Vz of the local coordinate system LocalCsys remain unchanged.

[0308] S8. Calculation of body related dimensions

[0309] Calculate the size information corresponding to the cube body represented by subgroup 7.

[0310] Specifically, the position of the local coordinate system is adjusted in the above step 7. Under the adjusted local coordinate system LocalCsys, the bounding box LocalBodyBox(minPnt(8.55,2.2,0.1),maxPnt(11.45,3.8,1.1)) of the cube body represented by subgroup 7 is obtained, with length L=LocalBodyBox.maxPnt.x-LocalBodyBox.minPnt.x=11.45–8.55=2.9, W= LocalBodyBox.maxPnt.y-LocalBodyBox.minPnt.y=3.8–2.2=1.6, high H=LocalBodyBox.maxPnt.z-LocalBody Box.minPnt.z=1.1–0.1=1.0, center point Center=((8.55+11.45) / 2, (2.2+3.8) / 2, (0.1+1.1) / 2)=(10.0,3.0,0.6).

[0311] In the local coordinate system LocalCsys, a through hole on the body parallel to the Z axis of the coordinate system LocalCsys is calculated.

[0312] The first step is to project the body along the Z-axis direction of the local coordinate system LocalCsys to obtain the line segment set Set”={seg”{end1(11.45,2.306,0.0),end2(11.45,3.694,0.0)},…,seg”{end1(11.148,3.483,0.0),end2(11.144,3.466,0.0)}} and the outer contour line W”{seg”{end1(11.45,2.306,0.0),end2(11.45,3.694,0.0)},…,seg”{end1(8.55,2.236,0.0),end2(8.55,3.764,0.0)}} after all the body projections. The calculation method is consistent with the body projection method in step S5.2.

[0313] The second step is to delete all the outer contour lines W" contained in the line segment set Set".

[0314] In the third step, since there is no line segment that does not pass through the main body in this model, there is no need to execute the step of deleting the projection line segment that does not pass through the main body in the line segment set "Set".

[0315] The fourth step is to obtain the line segments connected end to end in the line segment set "Set". For details, please refer to the specific process of obtaining the line segments connected end to end in the aforementioned line segment set "Set".

[0316] Step 5, get all the inner contours. Finally, we get the section set sequence SSection = {S1{seg”{end1(11.148,3.483,0.0),end2(11.144,3.466,0.0)},……,seg”{end1(11.148,3.517,0.0),end2(11.15,3.5,0.0)}}}, the section set sequence SSection contains only one subset, that is, only one section shape.

[0317] Step 6. Through the third shape determination method in step S5.2, it can be obtained that the above cross-sectional shape is circular. At the same time, the cross-sectional center of the circular through hole Center section = (11.05, 3.5, 0.0), R section = 0.1.

[0318] S9, Pin Calculation

[0319] In the local coordinate system LocalCsys, according to the pin shape type J6 calculated in step 6, the size information of each pin is calculated in turn. Taking the pin represented by subgroup 1 as an example, the calculation process is as follows:

[0320] The first step is to adjust the local coordinate system localCsys. Calculate the shortest distance between the pin boundary and the body boundary, and you can get that the distance between the pin and the lower boundary of the body is 0. This pin belongs to the IV region, such as Figure 5 , according to the coordinate system posture adjustment rules, the X-axis of the local coordinate system LocalCsys rotates 180° counterclockwise around the Z-axis (from the positive direction of the Z-axis to the negative direction of the Z-axis);

[0321] The second step is to obtain the pin's bounding box J6Box (minPnt (-9.25, -4.4, 0), maxPnt (-8.85, -3.8, 0.9)) in the latest local coordinate system LocalCsys (after adjustment in the above steps);

[0322] Step 3: Based on the bounding box J6Box, calculate the size of the J6 pin A = J6Box.maxPnt.x–J6Box.minPnt.x = -8.85–(-9.25) = 0.4, the size D = J6Box.maxPnt.z–J6Box.minPnt.z = 0.9–0 = 0.9, and the center point Center = ((-9.25+(-8.85)) / 2, (-4.4+(-3.8)) / 2, (0+0.9) / 2) = (-9.05, -4.1, 0.45);

[0323] Step 4. Traverse all planes whose normal vectors of the J6 pin are parallel to the Z axis of the coordinate system, and calculate each plane in turn until the bottom surface of the J6 pin is found. The calculation method is as follows: First, obtain a point pnt on the plane and the unit normal vector vec of the plane. If the normal vector vec is parallel to the Z axis vector Vz of the coordinate system and in the opposite direction, and satisfies pnt.z=J6Box.minPnt.z, then this plane is the bottom surface bottomFace of the J6 pin. Calculate the bounding box bottomBox(minPnt(-9.25,-4.4,0),maxPnt(-8.85,-4.15,0)) of the bottom surface bottomFace obtained by the above method, and the size of the J6 pin B=bottomBox.maxPnt.y–bottomBox.minPnt.y=-4.15–(-4.4)=0.25;

[0324] Step 5. Traverse all planes of the J6 pin that are parallel to the bottomFace and have opposite normal vectors, take the plane closest to the bottom surface as the backface of the J6 pin, and obtain the bounding box of the backface backBox(minPnt(-9.25,-4.4,0.15),maxPnt(-8.85,-4.15,0.15)). Then the size of the J6 pin C = backBox.maxPnt.z-bottomBox.maxPnt.z = 0.15.

[0325] Step 6: Restore the local coordinate system LocalCsys to the posture before the adjustment in the first step, and convert the center point calculated in the third step to the local coordinate system LocalCsys at this time, and obtain the latest center point of the J6 pin Center = (9.05, 4.1, 0.45);

[0326] Similarly, the size information of other pins can be obtained according to the above calculation method.

[0327] S10, assigning attributes according to the physical information of the component:

[0328] S10.1. Assign attribute values ​​to the model as a whole: package name = SOT-23-5, package type = SOT, manufacturer = XXX, material number = XXX, mass = 25 mg, power consumption = 350 mW, moisture sensitivity level = 1.

[0329] S10.2. Assign attribute values ​​to the body: color: black, material: phenolic resin, manufacturing tolerance: ±0.10.

[0330] S10.3. Assign attribute values ​​to the pins: Color: gray, Material: pure matte tin plating, Installation type: SMD (surface mount), Electrical properties: electrical, Manufacturing tolerance: ±0.10.

[0331] S11. Model parameter output (the units of the dimensions involved in this embodiment are all millimeters)

[0332] Table 1: Ontological data

[0333]

[0334] Table 2: Through hole data

[0335] name shape radius Center Via 1 Round 0.1 11.05,3.5,0.0

[0336] Table 3: Pin data

[0337]

[0338] Embodiment 3

[0339] See also Fig.19 , Fig.19 1 is a schematic diagram of a component modeling and model parameterization system provided by an embodiment of the present invention. The component modeling and model parameterization system includes:

[0340] An acquisition module, used to acquire component model data;

[0341] A splitting and clustering module, used for splitting and clustering the component model according to the information in the model data;

[0342] A sequence set generation module, which distinguishes the body and the pins of the component model according to the result of the split clustering, and obtains a body sequence set and a pin sequence set, wherein the body sequence set contains each body bounding box, and the pin sequence set contains each pin bounding box;

[0343] An identification module, used to determine the shapes of the body and the pins, and to identify the shape type of the pins;

[0344] A size calculation module, used to obtain the size of the body based on the shape of the body and the bounding box of the body, and to obtain the size of the pin based on the shape of the pin, the shape type and the bounding box of the pin;

[0345] Output module, used to output parameterized model data.

[0346] The component modeling and model parameterization system provided in this embodiment can execute the above method embodiments, and its implementation principles and technical effects are similar, which will not be repeated here.

[0347] Embodiment 4

[0348] See also Fig. 20 , Fig. 201 is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device 1100 includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102 and the memory 1103 communicate with each other through the communication bus 1104;

[0349] Memory 1103, used for storing computer programs;

[0350] The processor 1101 is configured to implement the above method steps when executing a computer program.

[0351] When the processor 1101 executes the computer program, part or all of the steps in the above embodiment 1 and embodiment 2 are implemented.

[0352] The electronic device provided by the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0353] Embodiment 5

[0354] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, some or all of the steps in the above embodiment 1 and embodiment 2 are implemented.

[0355] The computer-readable storage medium provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0356] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices (equipment), or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware, which are collectively referred to as "modules" or "systems" herein. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The computer program is stored / distributed in a suitable medium, provided together with other hardware or as a part of hardware, or may adopt other distribution forms, such as by the Internet or other wired or wireless telecommunication systems.

[0357] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0358] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.

[0359] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A method for component modeling and parameterization, characterized in that: include: Get component model data; According to the color information in the model data, the component model is split and clustered to obtain a sequence set List formed by arranging a plurality of subgroups; According to the splitting and clustering result, the body and the pins of the component model are distinguished to obtain a body sequence set and a pin sequence set, wherein the body sequence set contains each body bounding box, and the pin sequence set contains each pin bounding box; Determining the shapes of the body and the pins respectively, and identifying the shape type of the pins; The size of the body is obtained based on the shape of the body and the bounding box of the body, and the size of the pin is obtained based on the shape of the pin, the shape type and the bounding box of the pin; Export parameterized model data.

2. The method for component modeling and parameterization according to claim 1, characterized in that: Each of the subgroups includes: all faces of a single part, or several faces with the same color and connected outer contours, and the sequence set List includes several of the subgroups arranged in a preset order.

3. The method for component modeling and parameterization according to claim 2, characterized in that: The component model is split and clustered according to the color information in the model data to obtain a sequence set List formed by arranging a plurality of subgroups, including: Group all faces according to the color information of the faces in the model data to obtain num groups; When num>1, or num=1 and the model type is a part, all faces in each group are divided into a plurality of subgroups according to the principle of connecting outer contours; when num=1 and the model type is an assembly, each part is divided into different subgroups; Extracting contour points of each face in each of the subgroups; Obtaining the volume of the bounding box according to the maximum and minimum coordinate values ​​of x, y and z among the contour points; Sorting all the subgroups according to the volumes of the bounding boxes to obtain a sorting result; Based on the sorting result, the sequence set List is obtained according to the inclusion relationship between the i-th bounding box and each bounding box after the i-th bounding box.

4. The method for component modeling and parameterization according to claim 3, characterized in that: Based on the sorting result, the sequence set List is obtained according to the inclusion relationship between the i-th bounding box and each bounding box after the i-th bounding box, including: Based on the sorting result, the relationship between the coordinate values ​​of the i-th bounding box and each bounding box after the i-th bounding box is determined respectively; if the minimum x, y, and z coordinate values ​​of the i-th bounding box are all correspondingly less than or equal to the minimum x, y, and z coordinate values ​​of the j-th bounding box, and the maximum x, y, and z coordinate values ​​of the i-th bounding box are all correspondingly greater than or equal to the maximum x, y, and z coordinate values ​​of the j-th bounding box, then the i-th bounding box contains the j-th bounding box, and the j-th bounding box and the subgroup corresponding to the j-th bounding box are deleted to obtain the sequence set List, wherein the j-th bounding box is any bounding box after the i-th bounding box.

5. The method for component modeling and parameterization according to claim 1, characterized in that: According to the splitting and clustering results, the ontology and the pins of the component model are distinguished to obtain an ontology sequence set and a pin sequence set, including: The body sequence set and the pin sequence set are obtained according to the first volume ratio r1 and the second volume ratio r2, r1=Vbox / Vmax, r2=Vmin / Vbox, Vbox is the volume of the sub-group bounding box to be distinguished, Vmax is the volume of the maximum bounding box, and Vmin is the volume of the minimum bounding box; wherein, the sub-group with the largest volume of the bounding box is the body, and the sub-group with the smallest volume of the bounding box is the pin.

6. The method for component modeling and parameterization according to claim 5, characterized in that: A body sequence set and a pin sequence set are obtained according to the first volume ratio r1 and the second volume ratio r2, including: Determine the relationship between the first volume ratio r1 and the second volume ratio r2. If the first volume ratio r1 is greater than or equal to the second volume ratio r2, the subgroup to be distinguished is the body, otherwise the subgroup to be distinguished is the pin, until all subgroups are distinguished to obtain the body sequence set and the pin sequence set.

7. The method for component modeling and parameterization according to claim 1, characterized in that: Determining the shapes of the body and the pins respectively, and identifying the shape type of the pins, includes: Projecting each entity in the entity sequence set along the X, Y and Z axis directions of the local coordinate system respectively to obtain the shape of the entity; Each pin in the pin sequence set is projected along the X, Y and Z axis directions of the local coordinate system respectively to obtain the shape of the pin and identify the shape type to which the pin belongs.

8. The method for component modeling and parameterization according to claim 7, characterized in that: The method for establishing the local coordinate system is: In the absolute coordinate system, obtain the vector zV(vx,vy,vz) pointing from the center of all pins to the center of all bodies; Determine whether the projections of the bounding boxes of all the pins along the coordinate axes X, Y and Z are overlapped. If there is no overlap in a certain direction, add the coordinate value of the vector zV corresponding to the direction into the sequence set Vlist, and the sequence set Vlist sorts the coordinate values ​​in descending order according to the absolute values ​​of the coordinate values. When the absolute values ​​of the coordinate values ​​are the same, the sorting priority order is vz, vy, vx; Select the direction corresponding to the first coordinate value in the sequence set Vlist as the direction of the Z axis of the local coordinate system; Based on the positive or negative sign of the first coordinate value in the sequence set Vlist, the positive or negative direction of the Z-axis of the local coordinate system relative to the corresponding coordinate axis of the absolute coordinate system WorldCsys is determined.

9. The method for component modeling and parameterization according to claim 8, characterized in that: Projecting each entity in the entity sequence set along the X, Y and Z axis directions of the local coordinate system to obtain the shape of the entity, including: Projecting the body along the X, Y, and Z axis directions of the local coordinate system respectively to obtain three first projection shapes in the X, Y, and Z axis directions; The shape of the body is determined based on the three first projection shapes. If the three first projection shapes are all rectangular, the shape of the body is a cube; if one of the three first projection shapes is a circle, the shape of the body is a cylinder; the shapes of the remaining bodies are all polygons.

10. The method for component modeling and parameterization according to claim 8, characterized in that: Projecting each pin in the pin sequence set along the X, Y and Z axis directions of the local coordinate system respectively to obtain the shape of the pin, and identifying the shape type of the pin, including: Projecting each of the pins in the pin sequence set along the X, Y, and Z axis directions of the local coordinate system respectively to obtain three second projection shapes in the X, Y, and Z axis directions; The shape of the pin is determined according to the three second projection shapes. First, if the three second projection shapes are all rectangular, the shape of the pin is a cube; second, if the three second projection shapes are all circular, the shape of the pin is a sphere; third, if one of the three second projection shapes is circular, the shape of the pin is a cylinder; finally, the shapes of the remaining pins are all polygons; Calculating the distribution characteristics of each pin in the top view of the component, and taking the positional relationship between the pin and the body in the top view as the distribution characteristics of the pin; Based on the local coordinate system, respectively calculate the overlapping lengths of each pin and all the bodies on the X, Y and Z axes, and respectively calculate the body overlap and the pin overlap based on the overlapping lengths, so as to use the body overlap and the pin overlap as local features of the pin; According to the three second projection shapes of the pin, respectively obtain the contour feature of each projection; The shape type of the pin is distinguished according to the shape of the pin and / or the distribution feature and / or the local feature and / or the contour feature.

11. The method for component modeling and parameterization according to claim 10, characterized in that: Calculating the distribution characteristics of each pin in the top view of the component, and taking the positional relationship between the pin and the body in the top view as the distribution characteristics of the pin, including: Obtaining the outer contour line of the body projected along the Z-axis direction and the outer contour points of the pin projected along the Z-axis direction; Determine the positional relationship between the outer contour points of the pin and the outer contour line of the body. If all the outer contour points of the pin are on the outer contour line of the body, the pin is considered to be within the outer contour line of the body; the rest are based on whether the outer contour points of the pin are within or outside the outer contour line of the body, and the points on the outer contour line of the body are ignored. The positional relationship between the outer contour points of the pin and the outer contour line of the body is determined based on the remaining points: If the remaining outer contour points of the pin are all within the outer contour line of the body, then the outer contour points of the pin are within the outer contour line of the body; If the remaining outer contour points of the pin are all outside the outer contour line of the body, then the outer contour point of the pin is outside the outer contour line of the body; If the remaining part of the outer contour points of the pin are outside the outer contour line of the main body and the remaining part of the outer contour points of the pin are inside the outer contour line of the main body, the pin intersects with the main body.

12. The method for component modeling and parameterization according to claim 10, characterized in that: Based on the overlap length, the body overlap and the pin overlap are calculated respectively, so as to use the body overlap and the pin overlap as local features of the pin, including: Based on the preset axis, the larger value between the minimum value of the coordinate values ​​of the bounding box of all the bodies and the minimum value of the coordinate values ​​of the bounding box of the current pin is selected as D1, and the smaller value between the maximum value of the coordinate value of the bounding box of the body and the maximum value of the coordinate value of the bounding box of the current pin is selected as D2; Judge the relationship between D1 and D2. If D1≥D2, then the body overlap degree and the pin overlap degree on the preset axis are both 0. If D1<D2, the body overlap degree is overLen / (body1 - body2), and the pin overlap degree is overLen / (pin1 - pin2), where body1 and body2 are respectively the maximum and minimum coordinate values of the bounding box of the body on the preset axis, pin1 and pin2 are respectively the maximum and minimum coordinate values of the bounding box of the pin on the preset axis, and overLen is the overlap length.

13. The component modeling and parameterization method according to claim 10, characterized in that: According to the three second projection shapes of the pin, obtain the contour features of each projection respectively, including: Based on the preset axis, draw a horizontal auxiliary line Guid1 through the center of the pin projection shape, and obtain two intersection points of the horizontal auxiliary line Guid1 and the pin projection shape; Draw two vertical auxiliary lines Guid2 and Guid3 through the two intersection points, where the vertical auxiliary line Guid3 is on the right side of the vertical auxiliary line Guid2; Judge the relationship between the vertices of the pin projection and the horizontal auxiliary line Guid1, the vertical auxiliary lines Guid2 and Guid3. If the vertex is above the horizontal auxiliary line Guid1 and on the right side of the vertical auxiliary line Guid3, then the vertex is in the first region. If the vertex is above the horizontal auxiliary line Guid1 and on the left side of the vertical auxiliary line Guid2, then the vertex is in the second region. If the vertex is below the horizontal auxiliary line Guid1 and on the left side of the vertical auxiliary line Guid2, then the vertex is in the third region. If the vertex is below the horizontal auxiliary line Guid1 and on the right side of the vertical auxiliary line Guid3, then the vertex is in the fourth region. Take the combination formed by the regions where all the vertices on both sides of the vertical auxiliary line Guid2 and the vertical auxiliary line Guid3 are located as the contour feature of the pin projection. Among them, when all vertices are on or / and between the vertical auxiliary line Guid2 and the vertical auxiliary line Guid3, the contour feature is empty.

14. The component modeling and parameterization method according to claim 9 or 10, characterized in that: The projection shape judgment method includes: Traverse all the edges of the body or the pin, discretize all the edges by length, and obtain a set of line segments Set; Project the line segments in the line segment set Set onto the coordinate system plane along the preset direction in turn to obtain the projected line segment set Set', and the preset directions include the X, Y, and Z axis directions; According to the vertices of the outer contour of the line segment set Set', the contour area S and the area S of the minimum circumscribed rectangle are obtained. 矩形 and the area of ​​the smallest circumscribed circle S 圆 ; According to r 矩形 、r 矩形 The area ratio threshold K, r 圆 and r 圆 The area ratio threshold K1 determines the projection shape. If r 矩形 >r 圆 And r 矩形 >K, the projection shape is a rectangle. If r 圆 >r 矩形 And r 圆 >K1, the projection shape is a circle, otherwise the projection shape is a polygon, where r 矩形 =S / S 矩形 , r 圆 =S / S 圆 .

15. The method for component modeling and parameterization according to claim 14, characterized in that: The method for obtaining the vertices of the outer contour line of the line segment set Set' includes: Judge whether each line segment in the line segment set Set' intersects with other line segments in turn. If there is an intersection point and the intersection point is not at the end point of the line segment, then divide the line segment at the intersection point; Based on all the divided line segments, group the line segments with the same vertices into one group, and only keep one line segment for the line segments with the same two end points; Project all vertices onto the X-axis. Based on the projected points, select two adjacent points with the largest distance on the X-axis, and draw a straight line perpendicular to the X-axis through the midpoint of the coordinate values ​​of the two adjacent points on the X-axis. Obtain the minimum value of the Y-axis coordinate of the intersection points of the straight line and all the line segments in the line segment set Set'; Take the line segment with the smallest Y-axis coordinate value as the starting line segment of the outer contour line, and take the vertex at one end of the line segment as the starting point pstart and the vertex at the other end as the end point pend; Traverse all line segments in the line segment set Set' whose vertices have the same coordinate values ​​as the end point pend of the starting line segment, select a line segment with the largest angle with the starting line segment as the new starting line segment, and use the other end vertex of the new starting line segment as the new end point pend, iterate until the coordinates of the new end point pend are equal to the coordinates of the starting point pstart, then the iteration ends, thereby determining the line segments and vertices of the outer contour line.

16. The method for component modeling and parameterization according to claim 1, characterized in that: The component modeling and parameterization method also includes: The mounting plane is determined according to at least one of the pin bounding box and the body bounding box, and the pin type, and the local coordinate system is moved to the mounting plane.

17. The method for component modeling and parameterization according to claim 1, characterized in that: The component modeling and parameterization method further includes: calculating all through holes on the body parallel to the preset axis of the local coordinate system, wherein: Based on the local coordinate system, all the entities are projected along a preset axis direction of the local coordinate system to obtain a first line segment set Set" after all the entities are projected; Deleting the outer contour lines in the first line segment set Set” to obtain a second line segment set Set”; Deleting the projection line segments that do not pass through the body in the second line segment set Set” to obtain a third line segment set Set”; Line segments connected end to end are selected from the third line segment set Set'' to obtain a fourth line segment set Set'', wherein the fourth line segment set Set'' includes cross-sectional shapes of several through holes.

18. A component modeling and model parameterization system, characterized in that: include: An acquisition module, used to acquire component model data; A splitting and clustering module, used for splitting and clustering the component model according to the color information in the model data, to obtain a sequence set List formed by arranging a plurality of subgroups; A sequence set generation module, which distinguishes the body and the pins of the component model according to the result of the split clustering, and obtains a body sequence set and a pin sequence set, wherein the body sequence set contains each body bounding box, and the pin sequence set contains each pin bounding box; An identification module, used to determine the shapes of the body and the pins, and to identify the shape type of the pins; A size calculation module, used to obtain the size of the body based on the shape of the body and the bounding box of the body, and to obtain the size of the pin based on the shape of the pin, the shape type and the bounding box of the pin; Output module, used to output parameterized model data.

19. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory for storing computer programs; A processor, for implementing the method steps described in any one of claims 1 to 17 when executing the computer program.

20. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 17 are implemented.

Citation Information

Patent Citations

  • System and method for detecting pins of electronic component

    CN110554046A

  • Accessory modeling method, computer device and storage medium

    CN112862951A