WO2023103415A1 - 元器件建模及参数化的方法、***、电子设备及存储介质 - Google Patents

元器件建模及参数化的方法、***、电子设备及存储介质 Download PDF

Info

Publication number
WO2023103415A1
WO2023103415A1 PCT/CN2022/109345 CN2022109345W WO2023103415A1 WO 2023103415 A1 WO2023103415 A1 WO 2023103415A1 CN 2022109345 W CN2022109345 W CN 2022109345W WO 2023103415 A1 WO2023103415 A1 WO 2023103415A1
Authority
WO
WIPO (PCT)
Prior art keywords
pin
bounding box
pins
shape
line segment
Prior art date
Application number
PCT/CN2022/109345
Other languages
English (en)
French (fr)
Inventor
魏涛
刘继硕
钱胜杰
刘丰收
Original Assignee
上海望友信息科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海望友信息科技有限公司 filed Critical 上海望友信息科技有限公司
Publication of WO2023103415A1 publication Critical patent/WO2023103415A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Definitions

  • the invention belongs to the technical field of electronic manufacturing, and in particular relates to a component modeling and parameterization method, system, electronic equipment and storage medium.
  • the present invention provides a method, system, electronic equipment and storage medium for component modeling and parameterization.
  • the technical problem to be solved in the present invention is realized through the following technical solutions:
  • a component modeling and parameterization method comprising:
  • the ontology and pins of the component model are distinguished to obtain an ontology sequence set and a pin sequence set, the ontology sequence set contains each ontology bounding box, and the pin sequence set contains The bounding box of each pin;
  • An embodiment of the present invention also provides a component modeling and model parameterization system, including:
  • the acquisition module is used to acquire component model data
  • the split clustering module is used to split and cluster the component model according to the information in the model data
  • the sequence set generation module distinguishes the ontology and pins of the component model according to the result of the splitting and clustering, and obtains an ontology sequence set and a pin sequence set, the ontology sequence set contains each ontology bounding box, the The pin sequence set contains the bounding box of each pin;
  • An identification module configured to respectively judge the shape of the body and the pin, and identify the shape type of the pin
  • a size calculation module configured to obtain the body size based on the shape of the body and the bounding box of the body, and obtain the size of the pin based on the shape, shape type, and bounding box of the pin;
  • the output module is used to output parameterized model data.
  • An embodiment of the present invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus;
  • the processor is configured to implement the method steps described in any one of the foregoing embodiments when executing the computer program.
  • An embodiment of the present invention also provides a storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the method steps described in any one of the above-mentioned embodiments are implemented.
  • the method of the present invention can automatically output the simplified model file, and the component body and pins are highly differentiated, with less manual intervention, which greatly reduces the workload of the modeling personnel and effectively improves The calculation speed of model analysis and simulation software, as well as the accuracy of results.
  • the parametric model can be automatically generated by the method of the present invention, the body and pins of the model, and the shape of the body and pins can be automatically identified by software, the key dimensions of the body and pins can be extracted, and the parameterized body and pin shapes can be used Instead of the original model, the model structure can be simplified and the amount of model data can be greatly reduced.
  • the method of the present invention can automatically generate component model parameters, and assign different attribute values by distinguishing component bodies and pins, which facilitates parametric modeling and is convenient for use in different scenarios.
  • 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 in the production process.
  • MBD Model Based Definition
  • Fig. 1 is a schematic flowchart of a method for component modeling and parameterization provided by an embodiment of the present invention
  • Fig. 2 is a schematic flowchart of a method for obtaining a bounding box sequence set provided by an embodiment of the present invention
  • Fig. 3 is a schematic diagram of a bounding box provided by an embodiment of the present invention.
  • Fig. 4 is a schematic diagram of bodies of three different shapes provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a J6 pin layout provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a J8 pin layout provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a J6 pin polygonal projection provided by an embodiment of the present invention.
  • Fig. 8 is a schematic diagram of a J8 pin polygonal projection provided by an embodiment of the present invention.
  • Fig. 9 is a perspective view of a J2 pin provided by an embodiment of the present invention.
  • Fig. 10 is a perspective view of a J6 pin provided by an embodiment of the present invention.
  • Fig. 11 is a perspective view of a J8 pin provided by an embodiment of the present invention.
  • Fig. 12 is a perspective view of a J10 pin provided by an embodiment of the present invention.
  • Fig. 13 is a perspective view of a J14 pin provided by an embodiment of the present invention.
  • Fig. 14 is a schematic diagram of an algorithm for calculating an outer contour provided by an embodiment of the present invention.
  • Fig. 15 is a schematic diagram of a component model provided by an embodiment of the present invention.
  • FIG. 16 is a schematic cross-sectional view of a J6 pin provided by an embodiment of the present invention.
  • 17 is a schematic cross-sectional view of a J8 pin provided by an embodiment of the present invention.
  • FIG. 18 is a schematic cross-sectional view of a J10 pin provided by an embodiment of the present invention.
  • Fig. 19 is a schematic diagram of a component modeling and model parameterization system provided by an embodiment of the present invention.
  • Fig. 20 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a method for component modeling and parameterization provided by an embodiment of the present invention.
  • This embodiment provides a method for component modeling and parameterization.
  • the method may include From step 1 to step 10, it should be clear that the order of the steps set in this embodiment is only a specific implementation mode. In actual application, the order can be adjusted according to the actual situation. Therefore, this embodiment does not specify the specific steps order is limited. in:
  • Step 1 Obtain component model data.
  • model data includes: model type (part and assembly), part name, assembly relationship, 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 and color information of points, lines and surfaces.
  • Step 2 Split and cluster the component models according to the information in the model data.
  • step 2 may include:
  • num groups are divided to obtain several subgroups, so as to obtain the sequence set List according to all subgroups.
  • all surfaces are grouped according to color, and surfaces of the same color are divided into one group according to the color of each surface, a total of num groups, and then num groups are divided into several subgroups, and each subgroup Including: all surfaces of a single part, or several surfaces with the same color and connected outer contours, the bounding box of each subgroup is obtained through calculation, based on the above content, a sequence set List including all subgroups can be obtained, and the sequence set List includes Several subgroups are arranged in a preset order, and the bounding box is the smallest circumscribed cube of the subgroup.
  • the preset order can be sorted according to the size of the bounding box. For example, the preset order is to sort the volume of the bounding box from large to small Sort.
  • the specific acquisition method of the sequence set List may include:
  • Step 2.1 Group all the faces according to the color information of the faces in the model data to obtain num groups, where all the faces in each group have the same color.
  • Step 2.21 Divide all faces in each group into N subgroups according to the principle of connecting outer contours.
  • the outer contours are connected means that there is at least one line collinear between the outer contours of two adjacent surfaces.
  • Step 2.3 loop through all the faces, and extract the contour points of each face in each subgroup.
  • step 2.4 the volume of the bounding box is obtained according to the maximum and minimum coordinate values of x, y, and z in the contour points.
  • 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
  • the maximum z coordinate value and the minimum z coordinate value in the z coordinate value, the minimum x, y, z coordinate value is used as the minimum point minPnt of the bounding box
  • the maximum x, y, z coordinate value is used as the maximum point maxPnt of the bounding box.
  • Step 2.5 sort all the subgroups according to the size of the bounding box volume to obtain the sorting result.
  • Step 2.6 Based on the sorting result, a List sequence set is obtained according to the containment relationship between the i-th bounding box and each bounding box after the i-th bounding box.
  • the containment relationship of the i-th bounding box and each bounding box after the i-th bounding box determines whether it is a containment relationship, the contained bounding box and the subgroup corresponding to the bounding box are selected from the initial sequence set List to get the final sequence set List.
  • step 2.6 may include:
  • the i-th bounding box contains the jth bounding box, and the jth bounding box and the subgroup corresponding to the jth bounding box are deleted from the initial sequence set to obtain the sequence set List, where the jth bounding box is the ith Any bounding box after the bounding box.
  • the bounding box Box1 completely contains the bounding box Box2, delete the element (Box2: subgroup 2) in the initial sequence set List; 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 respectively represent bounding boxes The x, y and z coordinates of the minimum point minPnt of Box1 and Box2, Box1.maxPnt.x, Box1.maxPnt.y, Box1.
  • Step 3 According to the result of splitting and clustering, distinguish the ontology and pins of the component model, and obtain the ontology sequence set and the pin sequence set.
  • step 3 may include:
  • the current subgroup to be distinguished is the ontology, otherwise the current subgroup to be distinguished is the pin until all subgroups are distinguished, and the ontology sequence set and the pin sequence set are obtained.
  • the subgroup with the largest bounding box volume in 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).
  • Step 4 respectively judge the shape of the body and the pin, and identify the shape type of the pin.
  • Step 4.1 Project each ontology in the ontology sequence along the X, Y, and Z axes of the local coordinate system to obtain the shape of the ontology.
  • the local coordinate system LocalCsys needs to be created, and the establishment method of the local coordinate system LocalCsys is:
  • Step1 In the absolute coordinate system WorldCsys, obtain the vector zV(vx, vy, vz) pointing from the centers of all pins to the centers of all bodies.
  • Step2 determine whether the projections of the bounding boxes of all pins along the coordinate axes X, Y, and Z directions overlap. If there is no overlap in a certain direction, then the coordinates of the vector zV corresponding to the direction Values are added to the sequence set Vlist, for example, there is no overlap in the X-axis direction, then vx in the vector zV is added to the sequence set Vlist, and the sequence set Vlist sorts the coordinate values in descending order of the absolute value of the coordinate values, where , when the absolute values of the coordinate values are the same, the priority order of sorting is vz, vy, vx, that is, vz takes precedence over vy, and vy takes precedence over vx. Among them, the coordinate values corresponding to the vector zV in the overlapping direction belong to useless data.
  • Step3 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.
  • Step4 Based on the positive and negative of the first coordinate value in the sequence set Vlist, determine the positive and negative 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 that 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.
  • step 4.1 may include step 4.11-step 4.12, wherein:
  • Step 4.11 Project the body along the X, Y, and Z axes of the local coordinate system LocalCsys to obtain three first projection shapes in the X, Y, and Z axes. That is, under the local coordinate system LocalCsys, the index The feet are projected onto the coordinate system planes YOZ, ZOX, and XOY along the coordinate axes X, Y, and Z directions to obtain the projected shape.
  • Step 4.12 as shown in Figure 4, judge the shape of the body according to the three first projection shapes, if the three first projection shapes are all rectangles, then the shape of the body is a cube; if one of the three first projection shapes is If it is circular, the shape of the body is a cylinder; the shapes of other bodies are polygons.
  • Step 4.2 Project each pin in the pin sequence along the X, Y, and Z axes of the local coordinate system to obtain the shape of the pin and identify the shape type of the pin.
  • step 4.2 may include step 4.21-step 4.26, wherein:
  • Step 4.21 Project each pin in the pin sequence set PinList along the X, Y, and Z axes of the local coordinate system LocalCsys to obtain three second projection shapes in the X, Y, and Z axes. That is, in 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 shape.
  • the three second projected shapes are respectively recorded as Sx, Sy, Sz.
  • Step 4.22 Determine the shape of the pin according to the three second projection shapes. First, if the three second projection shapes are all rectangular, the pin shape is a cube; secondly, if the three second projection shapes are all circular , then the shape of the pin is a sphere; again, if one of the three second projected shapes is a circle, then the shape of the pin is a cylinder; finally, the shape of the rest of the pins is a polygon;
  • Step 4.23 calculate the distribution characteristics of each pin in the top view of the component (from the positive direction of the Z axis to the negative direction of the Z axis), and use the positional relationship between the pins and the body in the top view as the distribution characteristics of the pins.
  • step 4.23 may include step 4.231-step 4.232, wherein:
  • Step 4.231 Obtain the outer contour line projected along the Z-axis direction of the main body and the outer contour points projected along the Z-axis direction of the pin.
  • Step 4.232 Determine the positional relationship between the outer contour points of the pin and the outer contour of the body. If all the outer contour points of the pin are on the outer contour of the body, the pin is considered to be within the outer contour of the body ; The rest are based on the points of the outer contour of the pin being inside or outside the outer contour of the body, and ignoring the points on the outer contour of the body, and judging the positions of the outer contour points of the pin and the outer contour of the body based on the remaining points Relation: if the remaining outline points of the pin are all within the outline of the body, then the outline points of the pin are within the outline of the body; if the rest of the pin Outer contour points are all outside the outer contour of the body, then the outer contour points of the pin are outside the outer contour of the body; if the remaining part of the outer contour points of the pin are outside the outer contour of the body If the pin is outside the outer contour line and the remaining part of the outer contour points of the pin is within the outer contour line of the body, then the pin intersects the body
  • Step 4.24 Based on the local coordinate system LocalCsys, calculate the overlapping lengths of each pin and all bodies on the X, Y, and Z axes respectively, and calculate the body overlapping degree and the pin overlapping degree based on the overlapping length, so that the body overlapping degree and pin overlap as local features of pins.
  • step 4.24 may include step 4.241-step 4.243, wherein:
  • Step 4.242 Based on the preset axis, select the larger value of the minimum value of the coordinate values of the bounding box of all bodies and the minimum value of the coordinate value of the bounding box of the current pin as D1, and select the coordinate value of the bounding box of the body The smaller value of the maximum value and the maximum value of the coordinate value of the bounding box of the current pin is taken as D2, wherein, the preset axes include X axis, Y axis and Z axis, taking the X axis as an example, D1 is the step 4.241 X1 and D2 are X2 in step 4.241.
  • Step 4.243 Determine the relationship between D1 and D2. If D1 ⁇ D2, the body overlap and pin overlap are both 0 on the preset axis. If D1 ⁇ D2, the body overlap is overLen/(body1-body2). Pin overlap is overLen/(pin1-pin2), where body1 and body2 are the maximum and minimum coordinate values of the bounding box of the body on the preset axis, respectively, and pin1 and pin2 are the pin1 and pin2 respectively on the preset axis. The maximum and minimum values of the coordinates of the foot's bounding box.
  • the overlap between the body and pins on the X-axis is 0; otherwise, the overlap of the body on the X-axis is overLen/(bodyBox1.maxPnt.x-bodyBox1 .minPnt.x), the overlap of pins on the X axis is overLen/(pinBox1.maxPnt.x-pinBox1.minPnt.x).
  • the method for calculating the overlapping degree of the body and pins on the coordinate axes Y and Z is the same as the above method.
  • Step 4.25 according to the three second projection shapes of the pins, obtain the contour features of each projection respectively.
  • step 4.25 may include step 4.251-step 4.253, wherein:
  • Step 4.251 as shown in Figure 7 and Figure 8, based on the preset axis, draw the horizontal auxiliary line Guid1 through the center of the pin projection shape, and obtain two intersection points between the horizontal auxiliary line Guid1 and the pin projection shape.
  • Step 4.252 make two vertical auxiliary lines Guid2 and Guid3 through two intersection points, wherein the vertical auxiliary line Guid3 is on the right side of the vertical auxiliary line Guid2;
  • 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 on the right side of the vertical auxiliary line Guid3, the vertex is at the first Area, that is, area 1; if the vertex is above the horizontal auxiliary line Guid1 and to the left of the vertical auxiliary line Guid2, then the vertex is in the second area, that is, area 2; if the vertex is below the horizontal auxiliary line Guid1 and is in If the vertex is on the left side 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 on the right side of the vertical auxiliary line Guid3, then the vertex is in the fourth area, that is, the third area 4 area, the combination of the areas where all the vertices on both sides of the vertical auxiliary line Guid2 and the vertical auxiliary line Guid
  • the present invention does not impose unique restrictions on the acquisition order of the above-mentioned local features, distribution features, and contour features, and the order can be adjusted in the actual process.
  • Step 4.26 according to the shape and/or distribution features and/or local features and/or contour features of the pins, distinguish the shape type of the pins.
  • the shape type of each pin can be determined according to the above content.
  • five pin types are used as examples to illustrate, and they are respectively named J2, J6, J8, J10, and J14 , and it is analyzed and judged.
  • the judging methods for other types of pins can be judged according to the specific pins with reference to the above content. This embodiment will not repeat the description of other pin types.
  • the pin shape type is J2.
  • Pin shape the pin is a polygon (in the three projections of the pin, Sz is a rectangle, and one of Sx and Sy is a polygon);
  • Contour features Among the three projected shapes of the lead, there is one projected shape that satisfies that all vertices other than its two vertical auxiliary lines are in the 1, 3 area or 2, 4 area;
  • the pin shape type is J6.
  • Pin shape the pin is a polygon (in the three projections of the pin, Sz is a rectangle, and at least one of Sx and Sy is a polygon);
  • Contour features The contour features of at least one polygon in the projection of the pin are: among the three projected shapes of the pin, there is one projected shape that satisfies the fact that all polygon vertices other than its two vertical auxiliary lines are in 1, 4 Area or 2, 3 area;
  • the pin shape type is J8.
  • Pin shape the pin shape is a sphere
  • the pin shape type is J10.
  • Pin shape cube or cylinder or polygon (in the three projections of the pin, Sx and Sy are rectangles, and Sz is polygon);
  • Outline features when the shape of the pin is a cube or a cylinder, the outline features of the three projections of the pin are all empty; when the shape of the pin is a polygon, the outline features of the projections of the pin in the X and Y directions are all empty. Is empty;
  • the overlapping degree of the pins in the X and Y directions of the coordinate axis is 100%, and the overlapping degree of the pins in the Z direction of the coordinate axis is 0, and it is completely under the body (the negative direction of the Z direction);
  • the pin shape type is J14.
  • the projection shape judging method includes:
  • the directions include X, Y, and Z axis directions.
  • 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 to the XOY plane of the coordinate system to obtain the projected line segment set Set'.
  • Step3 According to the vertices of the outer contour line of the line segment set Set', obtain the contour area S, the area S of the smallest circumscribed rectangle, and the area S of the smallest circumscribed circle .
  • the preset values of K and K1 are preferably set to 0.85 and 0.9 respectively, and K and K1 can be adjusted according to actual needs, which is not specifically limited in this embodiment.
  • the method for obtaining the vertices of the outer contour of the line segment set Set' includes:
  • Step1 Determine in turn whether each line segment in the line segment set Set' intersects with other line segments (in the case of overlapping line segments, the endpoints of the overlapping parts are regarded as two intersection points). If there is an intersection point and the intersection point is not at the end point of the line segment, then the The line segment is divided from the intersection point. If there is no intersection point or there is an intersection point and the intersection point is the endpoint of the line segment, continue to calculate the next line segment until all the line segments are calculated.
  • Step2 Based on all the segmented segments, group the segments with the same vertex into one group, and keep only one segment for the segments with the same two endpoints.
  • Step4 obtain the minimum value of the Y-axis coordinates of the intersection points of the straight line L2 and all the line segments in the line segment set Set', the minimum value is Ymin as shown in Figure 14;
  • Step5 Take the line segment of the intersection point with the minimum Y-axis coordinate value as the starting line segment of the outer contour line, 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;
  • Step 5 Determine the installation plane according to at least one of the bounding box of the pin and the bounding box of the body, and the type of the pin, and move the local coordinate system to the installation plane.
  • the mounting surface is at the bottom of the component pin or the bottom of the body.
  • LocalCsys select the following steps corresponding to the shape type of the pin to calculate the component mounting plane.
  • the z coordinate value zCoord the calculation process is as follows:
  • the local coordinate system LocalCsys is moved to the installation plane.
  • the priority of the mounting plane of the combined pin is determined according to the pin type
  • the order is mounting type pin type > insertion type pin type.
  • the pin shape type includes both J6 and J14. According to the above priority, J6 is better than J14, so the component mounting plane corresponding to the J6 type pin is selected as the corresponding mounting plane in the case of the above multiple pin combinations.
  • Step 6 Obtain the size of the body based on the shape of the body and the bounding box of the body.
  • the corresponding size information of each ontology is calculated in turn.
  • the body shape is a cube, perform the following step 6.1; when the body shape is a cylinder, perform the following step 6.2; when the body shape is a polygon, perform the following step 6.3.
  • LocalCsys calculate the bounding box cubeBox of the body, determine the length, width, height and center point of the cube body according to the coordinates of the bounding box cubeBox, and return the calculation result.
  • LocalCsys calculate the bounding box cylinderBox of the body, calculate the lengths d1, d2, and d3 of the bounding box cylinderBox in the X, Y, and Z directions, and determine the cylinder according to the relationship between d1, d2, and d3 The radius, height and center point of the body, return the calculation result.
  • the first step is to obtain the outer contour point sets Wx, Wy, Wz of the projected shape of the ontology 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;
  • the second step is to calculate the bounding box polygonBox of the body in the local coordinate system LocalCsys, calculate the coordinates of the center point of the body according to the coordinates of the bounding box polygonBox, and calculate the approximate volume Mx, My based on the coordinates of the bounding box polygonBox and the above Sx, Sy, Sz , Mz, where:
  • Mx Sx*(polygonBox.maxPnt.x-polygonBox.minPnt.x)
  • polygonBox.maxPnt.x, polygonBox.maxPnt.y and polygonBox.maxPnt.z respectively represent the x, y and z coordinates of the maximum point maxPnt of the bounding box polygonBox
  • polygonBox.minPnt.x, polygonBox.minPnt.y and polygonBox .minPnt.z represent the x, y and z coordinate values of the minimum point minPnt of the bounding box polygonBox respectively.
  • the projection shape in the direction with the smallest volume among Mx, My, and Mz is closest to the real shape of the body, so that the height and contour point set of the polygon body can be determined, for example, Mx ⁇ My and Mx ⁇ Mz, that is, the projection shape in the X direction
  • Wx is the desired set of contour points
  • height H polygonBox.maxPnt.x-polygonBox.minPnt.x, when My or Mz is the smallest, the calculation method is the same as Wx, and will not be repeated here.
  • Step 7 Calculating all through holes on the body parallel to the preset axes of the local coordinate system.
  • the through-holes have three cross-sectional shapes: rectangle, circle, and polygon, for example, as shown in Figure 15 Show).
  • step 7 may include step 7.1-step 7.4, wherein:
  • Step 7.1 Based on the local coordinate system, project all bodies along the preset axis direction of the local coordinate system to obtain the first line segment set "Set” after projection of all bodies.
  • the method for obtaining the vertices of the line is "to obtain the outer contour line in the first line segment set Set", and the preset axis is, for example, the Z axis.
  • Step 7.2 delete the outer contour lines in the first line segment set "Set” to obtain the second line segment set "Set”.
  • the second set of line segment Set can be obtained by deleting the outer contour lines in the first set of line segments Set".
  • Step 7.3 Delete the projected line segments that do not penetrate the ontology in the second set of line segments "Set” to obtain the third set of line segments "Set”.
  • each line segment in the second line segment set "Set” in turn, make two straight lines with the two endpoints of the line segment, the direction of the two straight lines is parallel to the Z-axis direction of the coordinate system, and obtain the two straight lines and all the faces of the body Among all the intersection points, as long as any one of the intersection points is not on the contour line of the surface, delete this line segment in the second line segment set "Set", otherwise (all intersection points are on the contour line of the surface) continue to calculate A line segment, until all the line segments in the second line segment set "Set" are calculated, and the third line segment set "Set” is obtained.
  • Step 7.4 Select end-to-end line segments from the third line segment set "Set” to obtain the fourth line segment set "Set”.
  • the fourth line segment set "Set” includes cross-sectional shapes of several through holes.
  • each subset constitutes an inner contour respectively
  • the cross-sectional shape of each through-hole in the cross-section set sequence S-section is judged, and the result is rectangle, circle or polygon.
  • 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.
  • the size information of each pin is calculated in turn, that is, the driving size of each pin is calculated, and the driving size of each pin is determined.
  • the corresponding pin model can be automatically generated.
  • the size of each pin can be determined according to the above content.
  • This embodiment takes J2, J6, J8, J10, and J14 as examples for illustration.
  • the calculation method for other types of pin sizes can be determined according to the specific The pins are calculated with reference to the above content, and other pin types are not described in detail in this embodiment.
  • the first step is to calculate the bounding box J2Box of the pin under the local coordinate system LocalCsys.
  • 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.
  • dimension B J2Box.maxPnt.x - J2Box.minPnt.x
  • dimension A J2Box.maxPnt.y - J2Box.minPnt.y
  • dimension 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.z+J2Box.maxPnt.z)/2 ), where J2Box.minPnt.x, J2Box.minPnt.y and J2Box.minPnt.z represent the x, y and z coordinates of the minimum point minPnt of the bounding box J2Box respectively, and J2Box.maxPnt.x, J2Box.maxPnt.y and J2Box.maxPn
  • the J6 pins are distributed around the body, as shown in Figure 5, and the local coordinate system localCsys is adjusted accordingly to match the pose of the pins.
  • the second step is to calculate the bounding box J6Box of the pin under the latest (adjusted by the above steps) local coordinate system LocalCsys.
  • the third step is based on the bounding box J6Box to calculate the dimensions A, D, and center point coordinates of the J6 pin.
  • the size A J6Box.maxPnt.x-J6Box.minPnt.x
  • the fourth step is to traverse all the normal vectors of the J6 pin parallel to the plane of the Z axis of the coordinate system, and obtain the bottommost plane in the Z direction (viewed from the positive direction of the Z axis) as the bottom face 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, the size B bottomBox.maxPnt.y–bottomBox.minPnt.y, bottomBox.minPnt.y and bottomBox.maxPnt.y respectively represent the surrounding Box bottomBox minimum y coordinate and maximum y coordinate.
  • the fifth step is to find the nearest antiparallel surface (the parallel surface with the opposite normal vector) according to the bottom surface bottomFace in the above steps, and take the normal distance between the two surfaces as the dimension C of the J6 pin.
  • the sixth step is to restore the local coordinate system LocalCsys to the posture before the first step adjustment, and convert the center point calculated in the third step to the local coordinate system LocalCsys at this time.
  • the J8 pins are distributed around the body, as shown in Figure 6, and the local coordinate system localCsys is adjusted accordingly to match the pose of the pins.
  • the second step is to calculate the bounding box J8Box of the pin under the latest (adjusted by the above steps) local coordinate system LocalCsys.
  • the third step traverses all the surfaces of the J8 pin in turn to obtain the minimum coordinate value J8minPnt of each surface. If the minimum z-coordinate value of this surface is equal to the minimum z-coordinate value of the bounding box J8Box, then this Faces are added to the sequence set faceList until all faces of the J8 pin are calculated.
  • dimension A J8minBox.maxPnt.x - J8minBox.minPnt.x
  • dimension A1 J8Box.maxPnt.x - J8Box.minPnt.x
  • dimension D J8Box.maxPnt.z - J8Box.minPnt.z
  • J8minBox.minPnt .x and J8minBox.maxPnt.x indicate the minimum and maximum x coordinates of the bounding box J8minBox respectively
  • J8Box.minPnt.x, J8Box.minPnt.z, J8Box.maxPnt.x and J8Box.maxPnt.z respectively indicate the minimum bounding box J8Box x,z coordinates and max x,z coordinates.
  • the dimension C can be obtained according to the distance between the two vertical auxiliary lines in the outline feature used in the determination process of the pin type of the pin, that is, the dimension C is equal to the distance between the two vertical auxiliary lines.
  • the fifth step is to restore the local coordinate system LocalCsys to the posture before the first step adjustment, and convert the center point calculated in the third step to the local coordinate system LocalCsys at this time.
  • the pins are divided into their respective 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 area I; when the pin is closest to the lower boundary of the body, the pin belongs to area II; when the pin is closest to the left boundary of the body , the pin belongs to the third area; when the pin is the closest to the upper boundary of the body, the pin belongs to the fourth area; when the pin boundary crosses the boundaries in the three directions of the upper, lower, left, and right of the body , in the three directions, select the area in the middle direction as the area where the pin belongs, for example, when the pin boundary crosses the boundaries in the upper, lower, and left directions of the body, select the third area as the pin belongs to the region.
  • the local coordinate system is transformed accordingly to make it adapt to the space pose of the pin.
  • the specific rules are as follows, and the direction of rotation is reversible. The following takes counterclockwise as an example:
  • the X-axis of the local coordinate system LocalCsys rotates 90° counterclockwise around the Z-axis of the local coordinate system LocalCsys (viewed from the positive direction of the z-axis to the negative direction of the z-axis).
  • the local coordinate system LocalCsys remains unchanged.
  • the X-axis of the local coordinate system LocalCsys rotates 270° counterclockwise around the Z-axis of the local coordinate system LocalCsys (viewed from the positive direction of the z-axis to the negative direction of the z-axis).
  • the X-axis of the local coordinate system LocalCsys rotates 180° counterclockwise around the Z-axis of the local coordinate system LocalCsys (viewed from the positive direction of the z-axis to the negative direction of the z-axis).
  • the first step is to calculate the bounding box J10Box of the pin under the local coordinate system LocalCsys.
  • the shape type of the pin is J14, and the pin size information of the shape is a cube, as shown in Figure 13:
  • the first step is to calculate the bounding box J14Box1 of the rectangular pin in the local coordinate system LocalCsys.
  • the second step calculates the dimensions A, B, C and center point coordinates of the J14 rectangular pin according to the bounding box J14Box1.
  • dimension A J14Box1.maxPnt.x - J14Box1.minPnt.x
  • dimension B J14Box1.maxPnt.y - J14Box1.minPnt.y
  • dimension C J14Box1.maxPnt.z - J14Box1.minPnt.z, J14Box1.
  • minPnt.x, J14Box1.minPnt.y and J14Box1.minPnt.z represent the x, y and z coordinates of the minimum point minPnt of the bounding box J14Box1 respectively, and J14Box1.maxPnt.x, J14Box1.maxPnt.y and J14Box1.maxPnt.z respectively Indicates the x, y and z coordinates of the maximum point maxPnt of the bounding box J14Box1.
  • the pin shape type is J14, and the pin size information of the shape is a cylinder, as shown in Figure 13:
  • the first step is to calculate the bounding box J14Box2 of the circular pin in the local coordinate system LocalCsys.
  • the pin shape type is J14, and the pin size information is polygonal shape, as shown in Figure 13:
  • the first step is to calculate the bounding box J14Box3 of the polygon pin under the local coordinate system LocalCsys.
  • maxPnt.z-J14Box3.minPnt.z, J14Box3.minPnt.z, J14Box3.maxPnt.z represent the z coordinate value of the minimum point minPnt and the z coordinate value of the maximum point maxPnt of the bounding box J14Box3 respectively.
  • Step 9 Attribute assignment.
  • 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 humidity sensitivity level.
  • Step 9.2. Assign attribute values to the body, such as color, material, and manufacturing tolerance.
  • Step 10 output parameterized model data.
  • Model parameters include but are not limited to: the shape of the output ontology, and/or 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 coordinates of the through hole, etc.
  • the method of the present invention can automatically output the simplified model file, and the component body and pins are highly differentiated, with less manual intervention, greatly reducing the workload of modeling personnel, and effectively improving the model quality.
  • the coordinate axes involved in this scheme are preferred examples. In practice, the orientation adjustment and transformation of the coordinate axes can be carried out according to specific situations.
  • the preset axes, X axis, Y axis, and Z axis in this scheme are not uniquely limited.
  • this embodiment also provides a specific component modeling and parameterization method
  • the component modeling and parameterization method includes:
  • model data from the above mechanical 3D CAD design files, and the model data includes:
  • Model type part; component name: VY-1024; 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 and color information of point, line and surface: coordinates of all point, line and surface in the model, line vector, normal vector of surface and corresponding color (including black and Gray) and other data.
  • WorldCsys oil 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 and color information of point, line and surface coordinates of all point, line and surface in the model, line vector, normal vector of surface and corresponding color (including black and Gray) and other data.
  • the first step is to calculate the bounding boxes of each subgroup sequentially based on the point-line-surface geometric data in the above model data and according to the aforementioned method of calculating the bounding boxes as follows:
  • Vbox6 0.04
  • the third step is to deduplicate the bounding box.
  • the minimum xyz coordinate values (8.55, 2.2, 5.1) of box7 are all less than or equal to the minimum xyz coordinate values (10.95, 3.4, 5.1) of box6
  • the maximum xyz coordinates (11.45, 3.8, 6.1) of box7 are greater than or equal to the maximum xyz coordinates (11.15, 3.6, 6.1) of box6, that is, box7 completely contains box6, delete the element in the sequence set List (box6: child Group 6).
  • 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 local coordinate system
  • the local coordinate system LocalCsys and the absolute coordinate system WorldCsys completely overlap.
  • step S4 it is judged whether all the pins overlap in the X, Y, and Z directions of the coordinate axes.
  • the principle of judging whether the bounding boxes overlap along the coordinate axis is: 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, then the bounding boxes There is overlap in this direction, otherwise the bounding boxes have no overlap in this direction.
  • the principle of judging whether the projections of the bounding boxes on the coordinate axes overlap is as follows: the two smallest points of the two bounding boxes correspond to the larger value C1 of the coordinate values of this coordinate axis, and the two largest points of the two bounding boxes correspond to The smaller value C2 among the coordinate values of 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.
  • box2, box3, and box4 overlap in the X direction of the coordinate axis
  • box1, box4 overlap in the Y direction of the coordinate axis
  • box3, box5 overlap in the Y direction of the coordinate axis
  • all pins overlap in the Z axis
  • 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 local coordinate system LocalCsys
  • the z-axis direction of is the same as the z-axis direction corresponding to the absolute coordinate system WorldCsys.
  • the ontology represented by subgroup 7 is projected along the coordinate axes X, Y, and Z of the local coordinate system LocalCsys, and the three first projected shapes after projection are respectively calculated according to the following methods.
  • Body projection shape calculation taking Z-direction projection as an example:
  • the third step is to calculate the vertex set W of the outer contour of the line segment set Set', refer to FIG. 14 .
  • K and K1 as 0.85 and 0.9 respectively as an example, since r rectangle >r circle and r rectangle >0.85, the first projected shape of the main body in the Z direction is determined to be a rectangle.
  • the first projection shapes of the ontology represented by subgroup 7 in the X and Y directions are respectively calculated according to a similar method, and the first projection shapes of the X and Y directions are both rectangular, that is, the ontology represented by subgroup 7
  • the first projection shapes in three directions are all rectangles, so the main body is a cube.
  • the pins In the local coordinate system LocalCsys, project the pins along the coordinate axes X, Y, and Z directions respectively, and calculate the three second projection shapes Sx, Sy, and Sz after projection respectively.
  • the calculation method is the same as the first projection shape of the body in step 5.2.
  • the calculation methods are the same, and the obtained second projection shape Sx after projection is a polygon, Sy is a rectangle, and Sz is a rectangle, so the pin shape is a polygon.
  • the first step is to obtain the bounding boxes of all ontology:
  • LocalBodyListBox (minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1)) and the bounding box of the above pins LocalPinBox(minPnt(8.85,3.8,5.0),maxPnt(9.25,4.4,5.9)).
  • the second step is to calculate the bounding box overlap.
  • the overlap degree of the body on the Y axis is 0, and the overlap degree of the pins on the Y axis is 0; the overlap degree of the body on the Z axis is 80%, and the overlap degree of the pins on the Z axis is 88.9% %.
  • the shape type of the pin is distinguished according to the shape, and/or distribution features, and/or local features, and/or contour features of the pin, and the relevant features are as follows:
  • Pin shape the pin is a polygon
  • Contour features the projection shape Sx of the pin along the coordinate axis X direction satisfies that all vertices outside the two vertical auxiliary lines are in the 1 and 3 areas.
  • this pin is judged as a J6 type pin.
  • the position of the local coordinate system is adjusted in the above step 7.
  • the second step is to delete all the outer contour lines W" included in the line segment set "Set”.
  • the fourth step is to obtain the end-to-end line segments in the line segment set "Set". For details, refer to the specific process of obtaining the end-to-end connection in the line segment set "Set”.
  • the fifth step is to get all inner contours.
  • section set sequence S section ⁇ S1 ⁇ seg” ⁇ end1(11.148,3.483,0.0),end2(11.144,3.466,0.0) ⁇ , whil,seg” ⁇ end1(11.148,3.517,0.0),end2( 11.15,3.5,0.0) ⁇ , section set sequence S section contains only one sub-set, that is, there is only one section shape.
  • the sixth step through the shape discrimination method of the third step in step S5.2, the above-mentioned cross-sectional shape can be obtained as a circle, and the cross-sectional center of the circular through hole can be obtained at the same time. 0.1.
  • the first step is to adjust the local coordinate system localCsys. Calculate the shortest distance between the pin boundary and the body boundary, and the distance between the pin and the body lower boundary is 0, and this pin belongs to the fourth area, as shown in Figure 5.
  • the X axis of the local coordinate system LocalCsys Rotate 180° counterclockwise around the Z axis (viewed from the positive direction of the z axis to the negative direction of the z axis);
  • the second step is to obtain the bounding box of the pin J6Box(minPnt(-9.25,-4.4,0),maxPnt(-8.85,-3.8,0.9)) under the latest (adjusted by the above steps) local coordinate system LocalCsys ;
  • the fourth step is to traverse all the 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 size information of other pins can be obtained according to the above calculation method.
  • model parameter output (the unit of dimension involved in this embodiment is millimeter)
  • FIG. 19 is a schematic structural 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:
  • the acquisition module is used to acquire component model data
  • the split clustering module is used to split and cluster the component model according to the information in the model data
  • the sequence set generation module distinguishes the ontology and pins of the component model according to the result of the splitting and clustering, and obtains an ontology sequence set and a pin sequence set, the ontology sequence set contains each ontology bounding box, the The pin sequence set contains the bounding box of each pin;
  • An identification module configured to respectively judge the shape of the body and the pin, and identify the shape type of the pin
  • a size calculation module configured to obtain the body size based on the shape of the body and the bounding box of the body, and obtain the size of the pin based on the shape, shape type, and bounding box of the pin;
  • the output module is used to output parameterized model data.
  • the component modeling and model parameterization system provided in this embodiment can execute the above-mentioned method embodiment, and its implementation principle and technical effect are similar, and will not be repeated here.
  • FIG. 20 is a schematic structural diagram 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 complete mutual communication through the communication bus 1104;
  • the processor 1101 is configured to implement the above method steps when executing the computer program.
  • 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, and will not be repeated here.
  • This embodiment provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, some or all of the steps in the first and second embodiments above are implemented.
  • the computer-readable storage medium provided by the embodiments of the present invention can execute the above-mentioned method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the embodiments of the present application may be provided as methods, devices (devices), or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects, all of which are collectively referred to herein as "modules" or “systems.” Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The computer program is stored/distributed on suitable media, supplied with or as part of other hardware, and may also take other forms of distribution, such as via the Internet or other wired or wireless telecommunication systems.
  • first and second are used for description purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • “plurality” means two or more, unless otherwise specifically defined.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Computer Hardware Design (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种元器件建模及参数化的方法、***、电子设备及存储介质,方法包括:获取元器件模型数据;根据所述模型数据中的信息,对元器件模型进行拆分聚类;根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集;分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;输出参数化模型数据。本发明可自动输出简化后的模型文件,人工干预少,元器件本体、引脚区分度高,有效提高模型分析、仿真软件的计算速度及结果的准确性。

Description

元器件建模及参数化的方法、***、电子设备及存储介质 技术领域
本发明属于电子制造技术领域,具体涉及一种元器件建模及参数化的方法、***、电子设备及存储介质。
背景技术
在PCBA(Printed Circuit Board Assembly)设计环节中,各种元器件模型类型众多,数量庞大,模型的设计和仿真分析比较困难,原来的器件描述主要是边界表示法、网格模型等方式,这些方式表示的CAD模型过于详细、复杂,如果直接用于DFM(Design for manufacturability,可制造性设计)、仿真等软件,数据量大,分析、计算效率较低。
目前,行业内只能通过人工,手动提取CAD模型的关键尺寸,创建元器件参数化模型供DFM、仿真等软件使用。
然而,人工简化模型效率太低,且容易出错,审核困难,造成模型库维护成本高。
发明内容
为了解决现有技术中存在的上述问题,本发明提供了一种元器件建模及参数化的方法、***、电子设备及存储介质。本发明要解决的技术问题通过以下技术方案实现:
一种元器件建模及参数化的方法,包括:
获取元器件模型数据;
根据所述模型数据中的信息,对元器件模型进行拆分聚类;
根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,所述本体序列集中包含各个本体包围盒,所述引脚序列集中包含各个引脚的包围盒;
分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;
基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;
输出参数化模型数据。
本发明的一个实施例还提供一种元器件建模及模型参数化***,包括:
获取模块,用于获取元器件模型数据;
拆分聚类模块,用于根据所述模型数据中的信息,对元器件模型进行拆分聚类;
序列集生成模块,根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,所述本体序列集中包含各个本体包围盒,所述引脚序列集中包含各个引脚的包围盒;
识别模块,用于分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;
尺寸计算模块,用于基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;
输出模块,用于输出参数化模型数据。
本发明的一个实施例还提供一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时,实现上述任一项实施例所述的方法步骤。
本发明的一个实施例还提供一种存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项实施例所述的方法步骤。
本发明的有益效果:
1、相较于以前人工简化模型,使用本发明的方法可自动输出简化后的模型文件,且元器件本体、引脚区分度高,人工干预少,大大减少建模人员的工作量,有效提高了模型分析、仿真软件的计算速度,以及结果的准确性。
2、通过本发明的方法可自动生成参数化模型,通过软件自动识别模型的本体和引脚、及本体和引脚形状,提取本体和引脚的关键尺寸,使用参数化的本体、引脚形状代替原模型,从而可以简化模型结构,大大减少模型数据量。
3、通过本发明的方法可自动生成元器件模型参数,通过区分元器件本体和引脚,赋不同的属性值,方便参数化建模,便于分别使用于不同的场景。
4、本发明的方法可以服务于MBD(Model Based Definition),提供完整的产品定义信息,使数据质量更准确,有效降低生产过程的出错率。
以下将结合附图及实施例对本发明做进一步详细说明。
附图说明
图1是本发明实施例提供的一种元器件建模及参数化的方法的流程示意图;
图2是本发明实施例提供的一种包围盒序列集的获取方法的流程示意图;
图3是本发明实施例提供的一种包围盒的示意图;
图4是本发明实施例提供的三种不同形状的本体的示意图;
图5是本发明实施例提供的一种J6引脚布局的示意图;
图6是本发明实施例提供的一种J8引脚布局的示意图;
图7是本发明实施例提供的一种J6引脚多边形投影的示意图;
图8是本发明实施例提供的一种J8引脚多边形投影的示意图;
图9是本发明实施例提供的一种J2引脚的立体图;
图10是本发明实施例提供的一种J6引脚的立体图;
图11是本发明实施例提供的一种J8引脚的立体图;
图12是本发明实施例提供的一种J10引脚的立体图;
图13是本发明实施例提供的一种J14引脚的立体图;
图14是本发明实施例提供的一种计算外轮廓算法的示意图;
图15是本发明实施例提供的一种元器件模型的示意图;
图16是本发明实施例提供的一种J6引脚的截面示意图;
图17是本发明实施例提供的一种J8引脚的截面示意图;
图18是本发明实施例提供的一种J10引脚的截面示意图;
图19是本发明实施例提供的一种元器件建模及模型参数化***的示意图;
图20是本发明实施例提供的一种电子设备的结构示意图。
具体实施方式
下面结合具体实施例对本发明做进一步详细的描述,但本发明的实施方式不限于此。
实施例一
请参见图1,图1是本发明实施例提供的一种元器件建模及参数化的方法的流程示意图,本实施例提供了一种元器件建模及参数化的方法,该方法可以包括步骤1至步骤10,应该清楚的,本实施例所设定的步骤的顺序仅是一种具体的实施方式,在实际应用时,可以根据实际情况调整顺序,因此,本实施例不对具体的步骤顺序进行限定。其中:
步骤1、获取元器件模型数据。
具体地,首先读入机械三维CAD设计文件,包括step、stl等格式的文件。然后从以上机械三维CAD设计文件中获取元器件的模型数据,模型数据包括:模型类型(零件和装配)、零件的名称、装配关系、绝对坐标系WorldCsys(原点为(0.0,0.0,0.0)、X轴方向向量(1.0,0.0,0.0)、Y轴方向向量(0.0,1.0,0.0)、Z轴方向向量(0.0,0.0,1.0))、点线面的几何数据以及颜色信息。
步骤2、根据模型数据中的信息,对元器件模型进行拆分聚类。
在一个具体实施例中,步骤2可以包括:
基于模型数据中面的颜色信息划分的num个组得到若干个子组,以根据所有子组得到序列集List。
具体地,本实施例将所有的面按照颜色进行分组,根据各个面的颜色将相同颜色的面划分为一个组,共num个组,然后再将num个组划分为若干个子组,每个子组包括:单个零件的所有面、或若干颜色相同且外轮廓相连的面,通过计算得到每个子组的包围盒,基于上述内容,便可以得到一包括所有子组的序列集List,序列集List包括若干按照预设顺序排列的子组,包围盒为子组的最小外接立方体,其中,预设顺序可以为按照包围盒的大小进行排序,例如预设顺序为将包围盒体积按照从大到小进行排序。
在一个具体实施例中,请参见图2,序列集List的具体获取方式可以包括:
步骤2.1、根据模型数据中面的颜色信息将所有的面进行分组,得到num个组,其中,每个组中所有面的颜色均相同。
步骤2.2、当num>1、或者num=1且模型类型为零件时,将每个组中所有的面依据外轮廓相连的原则划分为若干个子组,当num=1且模型类型为装配时,将模型的各个零件分别分入不同的子组,也即一个零件对应一个子组。因此,每个子组可以包括:单个零件的所有面、或若干颜色相同且外轮廓相连的面。
也就是说,如果num>1,则忽略装配关系,执行2.21所示步骤;如果num=1,若模型类型=装配,则将各个零件的所有面分别分入不同的子组,并执行2.3所示步骤,若模型类型=零件,则执行2.21所示步骤。
步骤2.21、将每一组中所有面依据外轮廓相连的原则划分为N个子组。
其中,外轮廓相连是指相邻两个面的外轮廓之间至少有一条线共线。
步骤2.3、循环遍历所有面,提取每个子组中每个面的轮廓点。
步骤2.4、根据轮廓点中x、y和z的最大坐标值和最小坐标值得到包围盒的体积。
具体地,如图3所示,对于每个子组而言,获取所有点的x坐标值中的最大x坐标值和最小x坐标值、y坐标值中的最大y坐标值和最小y坐标值、z坐标值中的最大z坐标值和最小z坐标值,将最小的x、y、z坐标值作为包围盒最小点minPnt,最大x、y、z坐标值作为包围盒最大点maxPnt。
计算各个包围盒的长、宽、高,其中,长Lbox=maxPnt.x–minPnt.x,宽Wbox=maxPnt.y–minPnt.y,高Hbox=maxPnt.z–minPnt.z,包围盒的体积Vbox=Lbox×Wbox×Hbox,其中,maxPnt.x、maxPnt.y和maxPnt.z分别表示包围盒最大点maxPnt的x、y和z坐标值,minPnt.x、minPnt.y和minPnt.z分别表示包围盒最小点minPnt的x、y和z坐标值。
步骤2.5、根据包围盒体积的大小将所有的子组进行排序,以得到排序结果。
具体地,根据包围盒体积Vbox按照从大到小或者从小到大的顺序将所有的子组进行排序,以形成排序结果,该排序结果为初始的序列集List,如果包围盒体积相同,则按照子组序号的先后进行排序,例如,按照从大到小的顺序排序(本实施例以此为例进行说明),初始的序列集List={Box1:子组1,Box2:子组2,Box3:子组3,……,BoxN:子组N}。
步骤2.6、基于排序结果,根据第i个包围盒和第i个包围盒之后的各个包围盒的包含关系得到List序列集。
具体地,分别判断第i个包围盒和第i个包围盒之后的各个包围盒的包含关系,若为包含关系,则将被包含的包围盒及该包围盒对应的子组从初始的序列集List中删除,以得到最终的序列集List。
在一个具体实施例中,步骤2.6可以包括:
基于排序结果,分别判断第i个包围盒和第i个包围盒之后的各个包围盒的坐标值的关系,若第i个包围盒的最小x、y和z坐标值均对应小于或者等于第j个包围盒的最小x、y和z坐标值,且第i个包围盒的最大x、y和z坐标值均对应大于或者等于第j个包围盒的最大x、y和z坐标值,则第i个包围盒包含第j个包围盒,将第j个包围盒及第j个包围盒对应的子组从初始序列集中删除,以得到序列集List,其中,第j个包围盒为第i个包围盒之后的任意一个包围盒。
也就是说,依据上述包围盒排序结果,将初始的序列集List中每一个子组包围盒与其后的所有子组包围盒分别计算包含关系,计算过程如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,当以上6个条件同时满足时,则包围盒Box1完全包含包围盒Box2,在初始的序列集List中删除元素(Box2:子组2);否则继续,直至所有子组去重完成,其中,Box1.minPnt.x、Box1.minPnt.y、Box1.minPnt.z、Box2.minPnt.x、Box2.minPnt.y和Box2.minPnt.z分别表示包围盒Box1和包围盒Box2最小点minPnt的x、y和z坐标值,Box1.maxPnt.x、Box1.maxPnt.y、Box1.maxPnt.z、Box2.maxPnt.x、Box2.maxPnt.y和Box2.maxPnt.z分别表示包围盒Box1和包围盒Box2最大点maxPnt的x、y和z坐标值。
步骤3、根据拆分聚类的结果,区分元器件模型的本体和引脚,得到本体序列集和引脚序列集。
在一个具体实施例中,步骤3可以包括:
根据第一体积比r1、第二体积比r2得到本体序列集和引脚序列集,r1=Vbox/Vmax,r2=Vmin/Vbox,Vbox为当前待区分的子组包围盒的体积,Vmax为最大包围盒的体积,Vmin为最小包围盒的体积;其中,本体序列集中包含各个本体包围盒,引脚序列集中包含各个引脚的包围盒。
具体地,判断第一体积比r1和第二体积比r2的关系,若第一体积比r1大于或者等于第二体积比r2,则当前待区分的子组为本体,否则当前待区分的子组为引脚,直至区分完所有子组,得到本体序列集和引脚序列集。
也就是说,将所有子组中包围盒体积最大的子组当作本体(体积为Vmax),体积最小的子组当作引脚(体积为Vmin),其余的子组计算过程如下,按照包围盒体积Vbox分别计算与上述本体和引脚的体积比r1、r2,如果r1≥r2,此子组为本体,否则为引脚,直至所有子组区分完,最终形成本体序列集BodyList={Box1':子组1',Box2':子组2',Box3':子组3',……,BoxN':子组N'}(大部分元器件只有一个本体,极少数元器件有多个本体),引脚序列集PinList={Box1”:子组1”,Box2”:子组2”,Box3”:子组3”,……,BoxN”:子组N”},其中List=BodyList∪PinList,N=N'+N”。
步骤4、分别判断本体和引脚的形状,并识别引脚的形状类型。
步骤4.1、将本体序列集中每个本体沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到本体的形状。
在本实施例中,需要创建局部坐标系LocalCsys,局部坐标系LocalCsys的建立方法为:
Step1、在绝对坐标系WorldCsys中,获取从所有引脚的中心指向所有本体的中心的向量zV(vx,vy,vz)。
Step2、根据步骤3所得到的引脚包围盒判断所有引脚的包围盒沿坐标轴X、Y和Z方向的投影是否有重叠,若某方向无重叠,则将该方向对应的向量zV的坐标值添入序列集Vlist,例如X轴方向无重叠,则将向量zV中的vx加入序列集Vlist中,且序列集Vlist按坐标值的绝对值从大到小的顺序对坐标值进行排序,其中,当坐标值的绝对值相同时,排序的优先级顺序为vz、vy、vx,即vz优先于vy,vy优先于vx。其中,有重叠方向上对应的向量zV的坐标值属于无用数据。
Step3、选取序列集Vlist中第一个坐标值对应的方向作为局部坐标系LocalCsys的Z轴的方向。
Step4、基于序列集Vlist中第一个坐标值的正负,确定局部坐标系LocalCsys的Z轴方向相对于绝对坐标系WorldCsys对应坐标轴的正反,即第一个坐标值为大于或者等于0时,局部坐标系LocalCsys的Z轴方向与绝对坐标系WorldCsys对应坐标轴的方向相同,否则局部坐标系LocalCsys的Z轴方向与绝对坐标系WorldCsys对应坐标轴的方向相反。
在一个具体实施例中,步骤4.1可以包括步骤4.11-步骤4.12,其中:
步骤4.11、将本体沿着局部坐标系LocalCsys的X、Y、Z轴方向分别进行投影,以得 到X、Y、Z轴方向的三个第一投影形状,即在局部坐标系LocalCsys下,将引脚沿着坐标轴X、Y、Z方向分别投影到坐标系平面YOZ、ZOX、XOY,以得到投影后的形状。
步骤4.12、如图4所示,根据三个第一投影形状判断本体的形状,若三个第一投影形状均为矩形,则本体的形状为立方体;若三个第一投影形状中的一个为圆形,则本体的形状为圆柱体;其余本体的形状均为多边体。
步骤4.2、将引脚序列集中每个引脚沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到引脚的形状,并识别引脚所属的形状类型。
在一个具体实施例中,步骤4.2可以包括步骤4.21-步骤4.26,其中:
步骤4.21、将引脚序列集PinList中的每个引脚沿着局部坐标系LocalCsys的X、Y、Z轴方向分别进行投影,以得到X、Y、Z轴方向的三个第二投影形状,即在局部坐标系LocalCsys下,将本体沿着坐标轴X、Y、Z方向分别投影到坐标系平面YOZ、ZOX、XOY,以得到投影后的形状,三个第二投影形状分别记为Sx、Sy、Sz。
步骤4.22、根据三个第二投影形状判断引脚的形状,首先,若三个第二投影形状均为矩形,则引脚的形状为立方体;其次,若三个第二投影形状均为圆形,则引脚的形状为球体;再次,若三个第二投影形状中的一个为圆形,则引脚的形状为圆柱体;最后,其余引脚的形状为多边体;
步骤4.23、计算每个引脚在元器件俯视图(从Z轴正向往Z轴负向看)中的分布特征,将在俯视图中引脚与本体的位置关系作为引脚的分布特征。
在一个具体实施例中,步骤4.23可以包括步骤4.231-步骤4.232,其中:
步骤4.231、获取本体沿Z轴方向投影的外轮廓线和引脚沿Z轴方向投影的外轮廓点。
步骤4.232、判断引脚的外轮廓点与本体的外轮廓线的位置关系,若所述引脚外轮廓点全部在本体外轮廓线上,则视为引脚处于所述本体的外轮廓线内;其余均依据引脚外轮廓点在本体外轮廓线内或外轮廓线外,且忽略在本体外轮廓线上的点,基于剩余的点判断引脚的外轮廓点与本体外轮廓线的位置关系:若所述引脚的剩余外轮廓点都处于所述本体的外轮廓线内,则该所述引脚的外轮廓点处于所述本体的外轮廓线内;若所述引脚的剩余外轮廓点都处于所述本体的外轮廓线外,则该所述引脚的外轮廓点处于所述本体的外轮廓线外;若所述引脚剩余的部分外轮廓点处于所述本体的外轮廓线外且所述引脚剩余的部分外轮廓点处于所述本体的外轮廓线内,则该所述引脚与所述本体相交,例如如图5和图6所示。
步骤4.24、基于局部坐标系LocalCsys,分别计算每个引脚与所有本体在X、Y和Z轴上的重叠长度,基于重叠长度分别计算本体重叠度和引脚重叠度,以将该本体重叠度和引脚重叠度作为引脚的局部特征。
在一个具体实施例中,步骤4.24可以包括步骤4.241-步骤4.243,其中:
步骤4.241、在局部坐标系LocalCsys下,计算所有本体的包围盒bodyBox1和当前引脚的包围盒pinBox1,以坐标轴X为例:取bodyBox1.minPnt.x和pinBox1.minPnt.x中的较大值作为X1,取bodyBox1.maxPnt.x和pinBox1.maxPnt.x中的较小值作为X2,如果X1≥X2,X轴上本体和引脚的重叠度都为0;否则,重叠长度overLen=X2–X1,其中,bodyBox1.minPnt.x和bodyBox1.maxPnt.x分别表示包围盒bodyBox1和包围盒pinBox1最 小点minPnt的x坐标值,bodyBox1.maxPnt.x和pinBox1.maxPnt.x分别表示包围盒bodyBox1和包围盒pinBox1最大点maxPnt的x坐标值,关于坐标轴Y和坐标轴Z的重叠长度的计算方式同上,在此不再赘述。
步骤4.242、基于预设轴,选取所有本体的包围盒的坐标值的最小值与当前引脚的包围盒的坐标值的最小值中的较大值作为D1,选取本体的包围盒的坐标值的最大值与当前引脚的包围盒的坐标值的最大值中的较小值作为D2,其中,预设轴包括X轴、Y轴和Z轴,以X轴为例,D1即为步骤4.241的X1,D2即为步骤4.241的X2。
步骤4.243、判断D1和D2的关系,若D1≥D2,则在预设轴上本体重叠度和引脚重叠度均为0,若D1<D2,本体重叠度为overLen/(body1-body2),引脚重叠度为overLen/(pin1-pin2),其中,body1和body2分别为在预设轴上本体的包围盒的坐标值的最大值和最小值,pin1和pin2分别为在预设轴上引脚的包围盒的坐标值的最大值和最小值。
具体地,以坐标轴X为例,如果X1≥X2,X轴上本体和引脚的重叠度都为0;否则,本体在X轴上的重叠度为overLen/(bodyBox1.maxPnt.x-bodyBox1.minPnt.x),引脚在X轴上的重叠度为overLen/(pinBox1.maxPnt.x-pinBox1.minPnt.x)。同理,坐标轴Y、Z轴上的本体和引脚重叠度计算方法与上述方法相同。
步骤4.25、根据引脚的三个第二投影形状,分别得到每个投影的轮廓特征。
在一个具体实施例中,步骤4.25可以包括步骤4.251-步骤4.253,其中:
步骤4.251、如图7和图8所示,基于预设轴,通过过引脚投影形状的中心做水平辅助线Guid1,得到水平辅助线Guid1与引脚投影形状的两个交点。
步骤4.252、经过两个交点做两条竖直辅助线Guid2、Guid3,其中,竖直辅助线Guid3处于竖直辅助线Guid2的右侧;
步骤4.253、判断引脚投影的顶点与水平辅助线Guid1、竖直辅助线Guid2、Guid3的关系,若顶点在水平辅助线Guid1之上且处于竖直辅助线Guid3右侧,则顶点处在第一区域,即第①区域;若顶点在水平辅助线Guid1之上且处于竖直辅助线Guid2左侧,则顶点处在第二区域,即第②区域;若顶点在水平辅助线Guid1之下且处于竖直辅助线Guid2左侧,则顶点处在第三区域,即第③区域;若顶点在水平辅助线Guid1之下且处于竖直辅助线Guid3右侧,则顶点处在第四区域,即第④区域,将竖直辅助线Guid2和竖直辅助线Guid3两侧的所有顶点所处的区域构成的组合作为引脚投影的轮廓特征;当所有顶点处于竖直辅助线Guid2和竖直辅助线Guid3上或/和之间时,则轮廓特征为空。
需说明的是,本发明对上述局部特征、分布特征以及轮廓特征的获取顺序不进行唯一性限制,在实际过程中可进行顺序的调整。
步骤4.26、根据引脚的形状和/或分布特征和/或局部特征和/或轮廓特征,区分引脚所属的形状类型。
具体地,对于不同的引脚类型,均可以根据上述内容确定每个引脚的形状类型,本实施例以5种引脚类型为例进行说明,分别命名为J2、J6、J8、J10、J14,并对其进行分析和判断,对于其它类型引脚的判断方式可以根据具体的引脚参考上述内容进行判断,本实施例对其他引脚类型不再赘述。
根据以下判别标准,依次判别每个引脚的形状类型,具体判别标准如下
(1)J2引脚判别标准,J2引脚如图9所示。
1)引脚形状:本体和引脚都为立方体;
2)轮廓特征:引脚的三个投影的轮廓特征均为空;
3)局部特征:对于每个引脚,至少在坐标轴X、Y、Z中的两个方向上,本体重叠度都为100%;
当同时满足以上三个条件时,引脚形状类型即为J2。
(2)J6引脚判别标准,J6引脚如图10所示。
1)分布特征:如图5所示,在俯视图中,引脚处于本体外轮廓线外;
2)引脚形状:引脚为多边体(引脚的三个投影中,Sz为矩形,Sx和Sy其中之一为多边形);
3)轮廓特征:引脚的三个投影形状中,有一个投影形状满足其两条竖直辅助线之外的所有顶点处于①、③区域或者②、④区域;
当同时满足以上三个条件时,引脚形状类型为J6。
(3)J8引脚判别标准,J8引脚如图11所示。
1)分布特征:如图6所示,在俯视图中,引脚与本体外轮廓线相交;
2)引脚形状:引脚为多边体(引脚的三个投影中,Sz为矩形,Sx和Sy至少有一个为多边形);
3)轮廓特征:引脚的投影中至少有一个多边形的轮廓特征为:引脚的三个投影形状中,有一个投影形状满足其两条竖直辅助线之外的所有多边形顶点处于①、④区域或者②、③区域;
4)局部特征:对于每个引脚,在坐标轴Z方向上,本体和引脚的重叠度都小于100%;
当同时满足以上四个条件时,引脚形状类型为J8。
(4)J10引脚判别标准,J10引脚如图12所示。
1)分布特征:在俯视图中,引脚处于本体外轮廓线内部;
2)引脚形状:引脚形状为球体;
当同时满足以上两个条件时,引脚形状类型为J10。
(5)J14引脚的判别标准,J14引脚如图13所示。
1)分布特征:在俯视图中,引脚处于本体外轮廓线内部;
2)引脚形状:为立方体或者为圆柱体或者为多边体(引脚的三个投影中,Sx和Sy为矩形,Sz为多边形);
3)轮廓特征:当引脚形状为立方体或圆柱体时,引脚三个投影的轮廓特征均为空;当引脚形状为多边体时,引脚在X、Y方向的投影的轮廓特征均为空;
4)局部特征:在坐标轴X、Y方向上引脚的重叠度为100%,在坐标轴Z方向上引脚的重叠度为0,且完全处于本体下方(Z向的负方向);
当同时满足以上四个条件时,引脚形状类型为J14。
在一个具体实施例中,投影形状判断方法包括:
Step1、曲线离散化。遍历本体或引脚所有的边,按长度离散化所有的边,依次分割所有的边,得到线段集Set,Set={seg1,seg2,……,segN}。
Step2、依次将线段集Set中的线段沿着预设方向投影到坐标系平面上,得到投影后的线段集Set',Set'={seg1',seg2',……,segN'},预设方向包括X、Y和Z轴方向,例如预设方向为Z轴方向,则线段集Set中的线段沿着坐标轴Z轴方向投影到坐标系XOY平面,得到投影后的线段集Set'。
Step3、根据线段集Set'的外轮廓线的顶点得到轮廓面积S、最小外接矩形的面积S 矩形和最小外接圆的面积S
具体地,计算线段集Set'的外轮廓线的顶点集合W,提取其轮廓面积S,分别获取外轮廓顶点集合W的矩形包围盒R矩形(即最小外接矩形)的面积S 矩形和最小外接圆C外接圆的面积S
Step4、根据r 矩形、r 矩形的面积比阀值K、r 和r 的面积比阀值K1判断投影形状,若r 矩形>r 且r 矩形>K,则投影形状为矩形;若r >r 矩形且r >K1,则投影形状为圆形,否则投影形状为多边形,其中,r 矩形=S/S 矩形,r =S/S 。在实际应用中,K及K1预设值分别优先设置为0.85和0.9,K及K1可以根据实际需要自行调整,本实施例对此不作具体限定。
在一个具体实施例中,线段集Set'的外轮廓线的顶点的获取方法包括:
Step1、依次判断线段集Set'中的每一条线段与其他线段是否相交(线段重合的情况下,重合部分的端点视为2个交点),若有交点且交点不在该线段的端点,则将该线段从交点处分割,若无交点或有交点且交点在线段端点,则继续计算下一条线段,直至所有线段均计算完成。
Step2、基于分割后的所有线段,将具有相同顶点的线段归为一组,且两个端点都相同的线段仅保留一个线段。
Step3、在Step2的基础上,将所有顶点均投影至X轴上,基于投影之后的点,在X轴上选取间距最大的两个相邻点,以两个相邻点在X轴的坐标值的中点做垂直于X轴的直线,请参见图14,两个相邻点为x1、x2,中点c=(x1+x2)/2,则垂直于X轴的直线即为L2;
Step4、获取直线L2与线段集Set'中所有的线段的交点的Y轴坐标的最小值,该最小值如图14中的Ymin;
Step5、取具有最小Y轴坐标值的交点的线段作为外轮廓线的起始线段,以该线段的一端顶点为起点pstart,另一端顶点为终点pend;
Step6、遍历线段集Set'中线段的顶点与起始线段的终点pend坐标值相同的所有线段,在这些线段中选取与起始线段夹角最大的一条线段作为新的起始线段,将新的起始线段的另一端顶点作为新的终点pend,循环迭代Step6,直到新的终点pend坐标等于起点pstart坐标,则迭代结束,将所有找到的线段作为外轮廓线,取外轮廓线的顶点形成序列W={p1,p2,p3,……,pN},以此确定外轮廓线的线段及外轮廓线的顶点。
步骤5、根据引脚包围盒和本体包围盒中的至少一项、以及引脚类型确定安装平面,将局部坐标系移动到安装平面上。
一般情况下,对于元器件来说,安装面在元器件引脚底部或者本体底部,在局部坐标系LocalCsys下,根据引脚的形状类型选择以下与该形状类型对应的步骤,计算元器件安装平面的z坐标值zCoord,计算过程如下:
如果引脚类型为贴装类引脚,如J2、J6、J8、J10时,元器件安装平面在引脚底部,计算所有引脚的包围盒Jpinbox,即zCoord=Jpinbox.minPnt.z,其中,Jpinbox.minPnt.z为包围盒Jpinbox的最小点minPnt的z坐标值。
如果引脚的形状类型为插装类引脚,如J14时,元器件安装平面在本体底部,计算所有本体的包围盒LocalbodyBox,即zCoord=LocalbodyBox.minPnt.z,LocalbodyBox.minPnt.z为包围盒LocalbodyBox的最小点minPnt的z坐标值。
在上述计算完元器件安装平面之后,将局部坐标系LocalCsys移动到安装平面上。
另外,在实际中存在引脚形状类型为多种引脚组合的情况(即一个本体上有多种类型的引脚),此时依据引脚类型确定该组合型引脚的安装平面的优先级顺序为贴装类引脚类型>插装类引脚类型。例如,引脚形状类型同时包括J6和J14,按上述优先级,J6优于J14,所以选择J6类型的引脚对应的元器件安装平面作为上述多种引脚组合情况下对应的安装平面。
步骤6、基于本体的形状和本体的包围盒得到本体的尺寸。
如图4所示,在局部坐标系LocalCsys下,根据前述步骤计算所得到的本体形状,针对每个本体,依次计算每个本体对应的尺寸信息。具体的,当本体形状为立方体时,执行如下步骤6.1;当本体形状为圆柱体时,执行如下步骤6.2;当本体形状为多边体时,执行如下步骤6.3。
6.1计算立方体本体的长、宽、高以及中心点。
具体地,在局部坐标系LocalCsys下,计算本体的包围盒cubeBox,根据包围盒cubeBox的坐标确定立方体本体的长、宽、高以及中心点,返回计算结果。
6.2计算圆柱体本体的半径、高度以及中心点。
在局部坐标系LocalCsys下,计算本体的包围盒cylinderBox,计算包围盒cylinderBox在X、Y、Z三个方向上的长度d1、d2、d3,根据d1、d2、d3之间的关系,确定圆柱体本体的半径、高度以及中心点,返回计算结果。
6.3计算多边体本体的高度、轮廓点集合以及中心点。
第一步,分别获取本体在X、Y、Z方向投影形状的外轮廓点集Wx、Wy、Wz,提取其三个方向投影后的外轮廓的面积Sx、Sy、Sz;
第二步,在局部坐标系LocalCsys下,计算本体的包围盒polygonBox,根据包围盒polygonBox的坐标计算本体中心点坐标,基于该包围盒polygonBox的坐标和上述Sx、Sy、Sz计算近似体积Mx、My、Mz,其中:
Mx=Sx*(polygonBox.maxPnt.x-polygonBox.minPnt.x)
My=Sy*(polygonBox.maxPnt.y-polygonBox.minPnt.y)
Mz=Sz*(polygonBox.maxPnt.z-polygonBox.minPnt.z)
式中,polygonBox.maxPnt.x、polygonBox.maxPnt.y和polygonBox.maxPnt.z分别表示包围盒polygonBox最大点maxPnt的x、y和z坐标值,polygonBox.minPnt.x、polygonBox.minPnt.y和polygonBox.minPnt.z分别表示包围盒polygonBox最小点minPnt的x、y和z坐标值。
Mx、My和Mz中体积最小的方向上的投影形状最接近本体真实形状,以此便可以确 定多边体本体的高度、轮廓点集合,例如Mx≤My并且Mx≤Mz,即X方向的投影形状最接近本体真实形状,Wx即为所求轮廓点集合,高度H=polygonBox.maxPnt.x-polygonBox.minPnt.x,当My或Mz最小时,与Wx的计算方式相同,在此不再赘述。
步骤7、计算所有本体上平行于局部坐标系的预设轴的通孔。
具体地,在局部坐标系LocalCsys下,针对所有的本体,计算所有本体上平行于坐标系LocalCsys的预设轴的通孔(通孔有矩形、圆形、多边形三种截面形状,例如图15所示)。
在一个具体实施例中,步骤7可以包括步骤7.1-步骤7.4,其中:
步骤7.1、基于局部坐标系,将所有本体沿着局部坐标系的预设轴方向投影,得到所有本体投影后的第一线段集Set”,参考前述步骤4.26中“线段集Set'的外轮廓线的顶点的获取方法”得到第一线段集Set”中的外轮廓线,预设轴例如为Z轴。
步骤7.2、删除第一线段集Set”中的外轮廓线,得到第二线段集Set”。
具体地,由于第一线段集Set”中包含外轮廓线,因此将第一线段集Set”中的外轮廓线删除,便可以得到第二线段集Set”。
步骤7.3、删除第二线段集Set”中没有贯通本体的投影线段,得到第三线段集Set”。
具体地,依次循环遍历第二线段集Set”中的每一条线段,以线段两个端点做两条直线,两条直线的方向平行于坐标系Z轴方向,获取两条直线与本体所有的面的交点,在所有的交点中,只要其中任意一个交点没有在面的轮廓线上,则在第二线段集Set”中删除此线段,否则(所有交点都在面的轮廓线上)继续计算下一条线段,直到第二线段集Set”中的所有线段计算完成,得到第三线段集Set”。
步骤7.4、从第三线段集Set”中选择首尾相连的线段,得到第四线段集Set”,第四线段集Set”中包括若干通孔的截面形状。
具体地,依次循环遍历第三线段集Set”中的每一条线段,根据线段首尾相连的原则,如果线段两端都存在一条线段与其端点相连,则继续计算下一条线段,否则(该线段至少有一端不与任何线段相连),在第三线段集Set”中删除此线段。迭代执行此步骤,如果第三线段集Set”中剩余线段个数为零,说明本体上没有通孔,结束执行;否则,直到所有的线段都首尾相连,得到第四线段集Set”。
根据线段首尾相连的原则,将第四线段集Set”中剩余的所有的线段划分为M个子集合,确保每个子集合中的所有线段依次首尾相连,这样每一个子集分别构成一个内轮廓,每一个内轮廓代表一个通孔的截面形状,形成截面集合序列S截面={S1,S2,……,SM}。
之后,便可以依次计算每个通孔的截面形状。具体计算过程如下:
通过投影形状判别方法,判别截面集合序列S截面中每个通孔的截面形状,结果为矩形、圆形或多边形。
1)如果通孔截面形状为矩形,根据矩形包围盒的坐标计算矩形通孔的截面长度、宽度以及中心点,返回计算结果。
2)如果通孔截面形状为圆形,根据最小外接圆计算圆形通孔的截面圆心和半径,返回计算结果。
3)如果通孔截面形状为多边形,根据矩形包围盒的坐标计算多边形通孔的截面中 心点,轮廓点可根据截面子集中首尾相连的线段端点获取,返回计算结果。
步骤8、基于引脚的形状、引脚的形状类型、所述引脚的包围盒得到引脚的尺寸。
在局部坐标系LocalCsys下,根据前述步骤计算所得到的引脚形状及形状类型,依次计算每个引脚的尺寸信息,即计算每个引脚的驱动尺寸,在每个引脚的驱动尺寸确定下,便可以自动生成相应的引脚模型。对于不同的引脚类型,均可以根据上述内容确定每个引脚的尺寸,本实施例以J2、J6、J8、J10、J14为例进行说明,对于其它类型引脚尺寸的计算方式可以根据具体的引脚参考上述内容进行计算,本实施例对其他引脚类型不再赘述。
8.1引脚形状类型为J2,如图9所示:
第一步,在局部坐标系LocalCsys下,计算引脚的包围盒J2Box。
第二步,基于包围盒J2Box,计算J2引脚的尺寸B、A、C和中心点坐标。
具体地,尺寸B=J2Box.maxPnt.x-J2Box.minPnt.x,尺寸A=J2Box.maxPnt.y-J2Box.minPnt.y,尺寸C=J2Box.maxPnt.z-J2Box.minPnt.z,中心点Center=((J2Box.minPnt.x+J2Box.maxPnt.x)/2,(J2Box.minPnt.y+J2Box.maxPnt.y)/2,(J2Box.minPnt.z+J2Box.maxPnt.z)/2),其中,J2Box.minPnt.x、J2Box.minPnt.y和J2Box.minPnt.z分别表示包围盒J2Box最小点minPnt的x、y和z坐标值,J2Box.maxPnt.x、J2Box.maxPnt.y和J2Box.maxPnt.z分别表示包围盒J2Box最大点maxPnt的x、y和z坐标值。
8.2引脚形状类型为J6,如图10所示:
第一步,一般情况下J6引脚分布在本体四周,如图5所示,据此调整局部坐标系localCsys使之匹配此引脚位姿。
第二步,在最新的(经上述步骤调整后)局部坐标系LocalCsys下计算引脚的包围盒J6Box。
第三步,如图16所示,基于包围盒J6Box,计算J6引脚的尺寸A、D、中心点坐标。
具体地,尺寸A=J6Box.maxPnt.x–J6Box.minPnt.x,J6引脚的尺寸D=J6Box.maxPnt.z–J6Box.minPnt.z,其中,J6Box.minPnt.x和J6Box.minPnt.z分别表示包围盒J6Box最小点minPnt的x和z坐标值,J6Box.maxPnt.x和J6Box.maxPnt.z分别表示包围盒J6Box最大点maxPnt的x和z坐标值。
第四步,遍历J6引脚所有法向量平行于坐标系Z轴的平面,获取Z方向上最下方(从Z轴正向往反向看)的平面作为J6引脚的底面bottomFace。计算底面bottomFace的包围盒bottomBox,基于包围盒bottomBox计算J6引脚的尺寸B,即尺寸B=bottomBox.maxPnt.y–bottomBox.minPnt.y,bottomBox.minPnt.y和bottomBox.maxPnt.y分别表示包围盒bottomBox最小y坐标和最大y坐标。
第五步,根据上述步骤中底面bottomFace找到最近的反向平行面(法向量相反的平行面),取两个面之间的法向距离为J6引脚的尺寸C。
第六步,还原局部坐标系LocalCsys到第一步调整之前的姿态,并且将第三步计算所得中心点转换到此时的局部坐标系LocalCsys中。
8.3引脚形状类型为J8,如图11所示:
第一步,一般情况下J8引脚分布在本体四周,如图6所示,据此调整局部坐标系 localCsys使之匹配此引脚位姿。
第二步,在最新的(经上述步骤调整后)局部坐标系LocalCsys下计算引脚的包围盒J8Box。
第三步,如图11所示,依次遍历J8引脚所有的面,获取每一个面的最小坐标值J8minPnt,如果该面的最小z坐标值等于包围盒J8Box的最小z坐标值,则将此面添加到序列集faceList中,直到J8引脚所有的面都计算完成。之后,计算序列集faceList中所有面的包围盒J8minBox(形状为矩形),如图17所示,根据J8minBox的坐标和J8Box的坐标计算J8引脚的尺寸A、A1、D、中心点坐标,J8引脚的尺寸B取默认值B=Kb*A,以上引脚的尺寸B为引脚尺寸A的一定倍数,Kb可根据实际情况进行调整,Kb优先取值3.0。
其中,尺寸A=J8minBox.maxPnt.x–J8minBox.minPnt.x,尺寸A1=J8Box.maxPnt.x–J8Box.minPnt.x,尺寸D=J8Box.maxPnt.z–J8Box.minPnt.z,J8minBox.minPnt.x和J8minBox.maxPnt.x分别表示包围盒J8minBox的最小和最大x坐标,J8Box.minPnt.x、J8Box.minPnt.z、J8Box.maxPnt.x和J8Box.maxPnt.z依次表示包围盒J8Box的最小x、z坐标和最大x、z坐标。
第四步,尺寸C可根据此引脚的引脚类型判定过程中所用的轮廓特征中的两条竖直辅助线的间距得到,即尺寸C等于两条竖直辅助线的间距。
第五步,还原局部坐标系LocalCsys到第一步调整之前的姿态,并且将第三步计算所得中心点转换到此时的局部坐标系LocalCsys中。
在本实施例中,对于J6引脚和J8引脚而言,上述调整局部坐标系localCsys使之匹配引脚位姿的过程为:
1)如图5和图6所示,在元器件的俯视图中,根据引脚边界和本体边界距离最短原则,将引脚划分到所属的区域。具体的,在俯视图中,当引脚距离本体右边界最近时,引脚所属第Ⅰ区域;当引脚距离本体下边界最近时,引脚所属第Ⅱ区域;当引脚距离本体左边界最近时,引脚所属第Ⅲ区域;当引脚距离本体上边界最近时,引脚所属第Ⅳ区域;当引脚边界与本体上、下、左、右中的三个方向上的边界都有交叉时,在三个方向中,选择处于中间的方向所在区域作为引脚所属区域,如当引脚边界与本体上、下、左三个方向上的边界都有交叉时,选择第Ⅲ区域作为引脚所属区域。
2)根据引脚所属区域,对局部坐标系做相应的变换,使之适应引脚的空间位姿,具体规则如下,旋转方向可逆,以下以逆时针为例:
如果引脚所属第Ⅰ区域,局部坐标系LocalCsys的X轴绕局部坐标系LocalCsys的Z轴逆时针(从z轴正向往z轴负向看)旋转90°。
如果引脚所属第Ⅱ区域,局部坐标系LocalCsys保持不变。
如果引脚所属第Ⅲ区域,局部坐标系LocalCsys的X轴绕局部坐标系LocalCsys的Z轴逆时针(从z轴正向往z轴负向看)旋转270°。
如果引脚所属第Ⅳ区域,局部坐标系LocalCsys的X轴绕局部坐标系LocalCsys的Z轴逆时针(从z轴正向往z轴负向看)旋转180°。
8.4引脚形状类型为J10,如图12所示:
第一步,在局部坐标系LocalCsys下计算引脚的包围盒J10Box。
第二步,如图18所示,根据所述包围盒J10Box,计算J10引脚的尺寸A和中心点坐标,尺寸A=J10Box.maxPnt.x–J10Box.minPnt.x,J10Box.minPnt.x和J10Box.maxPnt.x分别表示包围盒J10Box的最小x坐标和最大x坐标。
8.5引脚形状类型为J14,形状为立方体的引脚尺寸信息,如图13所示:
第一步,在局部坐标系LocalCsys下计算矩形引脚的包围盒J14Box1。
第二步,如图13所示,根据包围盒J14Box1计算J14矩形引脚的尺寸A、B、C和中心点坐标。
具体地,尺寸A=J14Box1.maxPnt.x–J14Box1.minPnt.x,尺寸B=J14Box1.maxPnt.y–J14Box1.minPnt.y,尺寸C=J14Box1.maxPnt.z–J14Box1.minPnt.z,J14Box1.minPnt.x、J14Box1.minPnt.y和J14Box1.minPnt.z分别表示包围盒J14Box1最小点minPnt的x、y和z坐标值,J14Box1.maxPnt.x、J14Box1.maxPnt.y和J14Box1.maxPnt.z分别表示包围盒J14Box1最大点maxPnt的x、y和z坐标值。
8.6引脚形状类型为J14,形状为圆柱体的引脚尺寸信息,如图13所示:
第一步,在局部坐标系LocalCsys下计算圆形引脚的包围盒J14Box2。
第二步,如图13所示,根据包围盒J14Box2计算J14圆形引脚的尺寸A、C和中心点坐标,尺寸A=J14Box2.maxPnt.x–J14Box2.minPnt.x,尺寸C=J14Box2.maxPnt.z–J14Box2.minPnt.z,J14Box2.minPnt.x、J14Box2.minPnt.z分别表示包围盒J14Box2最小点minPnt的x、z坐标值,J14Box2.maxPnt.x、J14Box2.maxPnt.z分别表示包围盒J14Box2最大点maxPnt的x、z坐标值。
8.7引脚形状类型为J14,形状为多边体的引脚尺寸信息,如图13所示:
第一步,在局部坐标系LocalCsys下计算多边体引脚的包围盒J14Box3。
第二步,如图13所示,根据包围盒J14Box3计算J14多边体引脚的尺寸C和中心点坐标,轮廓点集合W可根据Z轴方向投影的结果Sz来进行获取,尺寸C=J14Box3.maxPnt.z-J14Box3.minPnt.z,J14Box3.minPnt.z、J14Box3.maxPnt.z分别表示包围盒J14Box3最小点minPnt的z坐标值和最大点maxPnt的z坐标值。
步骤9、属性赋值。
步骤9.1、给模型整体赋属性值,如封装名称、封装类型、制造商、料号、质量、功耗、湿敏等级。
步骤9.2、给本体赋属性值,如颜色、材质、制造公差。
步骤9.3、给引脚赋属性值,如颜色、材质、安装类型、电气属性、制造公差。
步骤10、输出参数化模型数据。
具体地,按照需求输出包括模型及模型参数的相应的格式文件,如CAD建模所需的STEP格式文件,元件库所需的数据文件等,模型参数包括不限于:输出本体的形状、和/或引脚所属的形状类型、和/或本体的尺寸、和/或本体的中心点坐标、和/或引脚的尺寸、和/或引脚的中心点坐标、和/或通孔的形状、和/或通孔的半径、和/或通孔的圆心坐标等。
相较于以前人工简化模型,使用本发明的方法可自动输出简化后的模型文件,且元器件本体、引脚区分度高,人工干预少,大大减少建模人员的工作量,有效提高了模型 分析、仿真软件的计算速度,以及结果的准确性。
本方案所涉及的坐标轴为优选示例,在实际中,可根据具体情况进行坐标轴的方位调整和变换,本方案中的预设轴、X轴、Y轴、Z轴不做唯一性限定。
实施例二
本实施例在上述实施例的基础上还提供一种具体地元器件建模及参数化的方法,该元器件建模及参数化的方法包括:
S1、读入机械三维CAD设计文件VY-1024.step,该文件对应的元器件模型如附图15所示。
S2、从以上机械三维CAD设计文件中获取模型数据,模型数据包括:
模型类型:零件;零部件的名称:VY-1024;绝对坐标系WorldCsys(原点为(0.0,0.0,0.0),X轴方向向量(1.0,0.0,0.0),Y轴方向向量(0.0,1.0,0.0),Z轴方向向量(0.0,0.0,1.0));点线面的几何数据以及颜色信息:模型中所有点线面的坐标、线的向量、面的法向量及对应颜色(包括黑色和灰色)等数据。
S3、模型拆分聚类
S3.1、针对所述模型,将其所有的面按颜色分组,得到组个数2。
S3.2、将每一组中所有的面依据外轮廓相连的原则划分,总共划分为7个子组。
S3.3、所有的子组计算包围盒,根据包围盒排序、去重。
第一步,基于上述模型数据中的点线面几何数据,并根据前述计算包围盒的方法依次计算各个子组的包围盒如下:
box1(minPnt(8.85,3.8,5),maxPnt(9.25,4.4,5.9)),
box2(minPnt(9.8,1.6,5),maxPnt(10.2,2.2,5.9)),
box3(minPnt(10.75,1.6,5),maxPnt(11.15,2.2,5.9)),
box4(minPnt(8.85,1.6,5),maxPnt(9.25,2.2,5.9)),
box5(minPnt(10.75,3.8,5),maxPnt(11.15,4.4,5.9)),
box6(minPnt(10.95,3.4,5.1),maxPnt(11.15,3.6,6.1)),
box7(minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1))。
第二步,根据包围盒排序。计算各个子组包围盒的长、宽、高,以包围盒box1为例:长Lbox1=9.25–8.85=0.4,宽Wbox1=4.4–3.8=0.6,高Hbox1=5.9–5=0.9,体积Vbox1=0.4×0.6×0.9=0.216,同理,其余子组对应包围盒体积计算与此相同。
本实施例中,Vbox1=Vbox2=Vbox3=Vbox4=Vbox5=0.216,Vbox6=0.04,Vbox7=4.64。根据包围盒体积从大到小将所有的子组排序,形成序列集List={box7:子组7,box1:子组1,box2:子组2,box3:子组3,box4:子组4,box5:子组5,box6:子组6}。
第三步,包围盒去重。结合以上各个子组的包围盒坐标,根据前述包围盒去重计算方法,可知box7的最小xyz坐标值(8.55,2.2,5.1)均小于或等于box6的最小xyz坐标值(10.95,3.4,5.1),且box7的最大xyz坐标值(11.45,3.8,6.1)均大于或等于box6的最大xyz坐标值(11.15,3.6,6.1),即box7完全包含box6,在序列集List中删除元素(box6:子组6)。
S4、区分元器件本体和引脚
以上剩余的6个子组中,将序列集List中第一个元素子组7当作本体, Vmax=Vbox7=4.64,将序列集List中最后一个元素子组5作为引脚,Vmin=Vbox5=0.216,其余的子组计算过程如下:以子组1为例,r1=Vbox1/Vmax=0.216/4.64=0.047,r2=Vmin/Vbox1=0.216/0.216=1.0,因为r2>r1,所以子组1为引脚。
同理,根据上述方法将其余所有子组全部进行区分,最终形成本体序列集BodyList={box7:子组7}(本实施例以只有一个本体为例进行说明),引脚序列集PinList={box1:子组1,box2:子组2,box3:子组3,box4:子组4,box5:子组5}。
S5、本体形状判别
S5.1、创建局部坐标系LocalCsys,并调整坐标系LocalCsys的Z轴方向。
第一步,以Origin=(0.0,0.0,0.0)为原点,Vx=(1.0,0.0,0.0)、Vy=(0.0,1.0,0.0)、Vz=(0.0,0.0,1.0)作为局部坐标系LocalCsys的X、Y、Z坐标轴的方向向量,此时局部坐标系LocalCsys与绝对坐标系WorldCsys完全重叠。
第二步,绝对坐标系WorldCsys中,根据步骤S4获取所有本体的包围盒BodyListBox(minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1)),所有本体的中心点BodyListCenter=((8.55+11.45)/2,(2.2+3.8)/2,(5.1+6.1)/2)=(10.0,3.0,5.6);获取所有引脚的包围盒PinListBox(minPnt(8.85,1.6,5.0),maxPnt(11.15,4.4,5.9)),所有引脚的中心点PinListCenter=((8.85+11.15)/2,(1.6+4.4)/2,(5.0+5.9)/2)=(10.0,3.0,5.45),从所有引脚的中心指向所有本体的中心的向量zV=(0.0,0.0,0.15)。
第三步,根据步骤S4所得引脚包围盒判别所有引脚在坐标轴X、Y、Z方向是否有重叠。
包围盒沿着坐标轴方向是否重叠的判别原则为:当判断包围盒在坐标轴某个方向是否有重叠时,如果包围盒在剩余的两个坐标轴上的投影都有重叠,则说明包围盒在此方向有重叠,否则包围盒在此方向无重叠。
包围盒在坐标轴上的投影是否重叠的判别原则为:取两个包围盒的两个最小点对应此坐标轴的坐标值中的较大值C1,取两个包围盒的两个最大点对应此坐标轴的坐标值中的较小值C2,如果C1≥C2,两个包围盒在此坐标轴上的投影无重叠,否则两个包围盒在此坐标轴上的投影有重叠。
以判断包围盒box1和box5在X轴方向上是否有重叠为例:取两个包围盒的两个最小点对应X坐标轴的坐标值box1.minPnt.x和box5.minPnt.x中的较大值C1=box5.minPnt.x=10.75,取两个包围盒的两个最大点对应X坐标轴的坐标值box1.maxPnt.x和box5.maxPnt.x中的较小值C2=box1.maxPnt.x=9.25,因为C1>C2,所以包围盒box1和box5在坐标轴X上的投影无重叠,同理可得包围盒box1和box5在坐标轴Y上的投影有重叠,在坐标轴Z上的投影有重叠,所以包围盒box1和box5沿着坐标轴X方向有重叠。
同理可得,box2、box3、box4在坐标轴X方向上有重叠,box1、box4在坐标轴Y方向上有重叠,box3、box5在坐标轴Y方向上有重叠,所有引脚在坐标轴Z向无重叠,将无重叠方向(坐标轴Z向)对应的向量zV的坐标值加入序列集Vlist,可得Vlist={0.15}。
第四步,取序列集Vlist中第一个坐标值0.15对应的方向(0.0,0.0,1.0)作为局部坐标系Z轴的方向,并且向量zV.z>0即0.15>0,局部坐标系LocalCsys的Z轴方向与绝对坐标系 WorldCsys对应的z轴方向相同。
S5.2、计算本体序列集BodyList中本体的形状。
将子组7代表的本体沿着局部坐标系LocalCsys的坐标轴X、Y、Z方向分别投影,根据如下方法分别计算投影后的三个第一投影形状。
本体投影形状计算(以Z向投影为例):
第一步,曲线离散化。遍历本体所有的边,如果是直线,则不需要离散化;如果是曲线,则按离散化间距(例如长度的十分之一)离散化所有的边,得到线段集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)}};
第二步,依次将线段集Set中的线段沿着坐标轴Z轴方向投影到坐标系XOY平面,得到投影后的线段集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)}};
第三步,计算线段集Set'的外轮廓线的顶点集合W,参考图14。
1)将线段集Set'中的每一条线段依次与其他所有线段计算是否相交(线段重合的情况下,重合部分的端点视为2个交点),如果有交点且交点不在该线段端点,则将线段从交点处分割,否则(无交点、或有交点且交点在线段端点),继续计算下一条线段,以线段集Set'中的两条线段为例:线段seg1'{end1(11.45,3.764,0.0),end2(11.45,3.8,0.0)}和线段seg2'{end1(11.45,3.8,0.0),end2(11.45,3.694,0.0)}的交点为P 交点1(11.45,3.8,0.0)和P 交点 2(11.45,3.694,0.0),P 交点1在线段seg1'的端点而无需分割,P 交点2将线段seg1'分割为两个线段seg11'{end1(11.45,3.764,0.0),end2(11.45,3.694,0.0)}和线段seg12'{end1(11.45,3.8,0.0),end2(11.45,3.694,0.0)},同理,直至所有线段计算完成;
2)将分割后的线段集Set'中所有线段按顶点分组,将具有相同顶点的线段归为一组,两个端点都相同的线段仅保留一个线段,例如线段seg11'和线段seg12'有相同的端点则归到同一组;
3)取所有顶点在X轴上间距最大的两个点的X坐标值x1=8.55,x2=10.95,以其两坐标值的中点c=(x1+x2)/2=9.75做垂直于X轴的直线L2:x=9.75,获取直线L2与线段集中所有的线段的交点的Y坐标的最小值2.2,最小值对应的线段为segYmin{end1(8.55,2.2,0.0),end2(11.45,2.2,0.0)},以端点segYmin.end1作为起点pstart,segYmin.end2作为终点pend;
4)遍历线段集Set'中线段顶点与终点pend坐标值相同的所有线段,取与起始线段夹角最大的一条线段作为新的起始线段,将新的起始线段的另一端顶点作为新的终点pend,循环迭代本步骤,直到新的终点坐标pend等于起点坐标pstart,迭代结束,将所有找到的线段作为外轮廓线,取轮廓线顶点形成序列W={p(8.55,2.2,0.0),p(11.45,2.2,0.0),……p(8.55,2.236,0.0)}。
第四步,获取线段集Set'的外轮廓线的轮廓面积S=4.64,分别获取外轮廓顶点集合W的矩形包围盒R 矩形的面积S 矩形=4.64和最小外接圆C 外接圆的面积S =8.62,分别计算外轮廓面积S与矩形R 矩形、外接圆C 外接圆面积的比值,r 矩形=S/S 矩形=4.64/4.64=1.0,r =S/S =4.64/8.62=0.54,本实施例以K及K1分别为0.85和0.9为例,因为r 矩形>r 且r 矩形>0.85,所 以本体Z向的第一投影形状判定为矩形。
同理,根据类似的方法分别计算子组7代表的本体在X向和Y向的第一投影形状,得出X向和Y向的第一投影形状均为矩形,即子组7代表的本体在三个方向的第一投影形状都为矩形,所以此本体为立方体。
S6、引脚形状类型判别
S6.1、计算引脚的形状
依次计算引脚序列集PinList中每一个引脚的形状。以子组1代表的引脚为例,计算过程如下:
在局部坐标系LocalCsys下,将引脚沿着坐标轴X、Y、Z方向分别投影,分别计算投影后的三个第二投影形状Sx、Sy、Sz,计算方法同5.2步骤本体第一投影形状计算方法一致,得到投影后的第二投影形状Sx为多边形、Sy为矩形、Sz为矩形,因此此引脚形状为多边体。
同理,根据类似的方法可得其他所有引脚均为多边体。
S6.2、在局部坐标系LocalCsys下,计算每个引脚的局部特征、分布特征和轮廓特征,以子组1代表的引脚为例:
1)局部特征。
第一步,获取所有本体的包围盒:
LocalBodyListBox(minPnt(8.55,2.2,5.1),maxPnt(11.45,3.8,6.1))以及上述引脚的包围盒LocalPinBox(minPnt(8.85,3.8,5.0),maxPnt(9.25,4.4,5.9))。
第二步,计算包围盒重叠度。
以坐标轴X为例:取LocalBodyListBox.minPnt.x和LocalPinBox.minPnt.x中的较大值作为X1=8.85,取LocalBodyListBox.maxPnt.x和LocalPinBox.maxPnt.x中的较小值作为X2=9.25,可得重叠长度overLen=X2–X1=9.25–8.85=0.4,本体在X轴上的重叠度为overLen/(LocalBodyListBox.maxPnt.x-LocalBodyListBox.minPnt.x)=0.4/(11.45–8.55)=13.8%,引脚在X轴上的重叠度为overLen/(LocalPinBox.maxPnt.x-LocalPinBox.minPnt.x)=0.4/(9.25–8.85)=100%。同理可得本体在Y轴上的重叠度为0,引脚在Y轴上的重叠度为0;本体在Z轴上的重叠度为80%,引脚在Z轴上的重叠度为88.9%。
2)分布特征。根据5.2步骤计算所得本体Z向投影外轮廓以及6.1步骤计算得到的引脚Z向投影外轮廓,根据判断点在多边形内外的现有算法,判断可知该引脚的部分外轮廓点处于本体外轮廓线上,剩余的所有引脚外轮廓点都处于本体外轮廓线外,参考图5所示,可得引脚在本体外轮廓线外。
3)轮廓特征。针对引脚的三个投影,根据前述轮廓特征计算方法,依次判别两条竖直辅助线之外的该引脚所有投影形状顶点所处的区域:该引脚沿着坐标轴Y、Z方向的投影Sx、Sy为矩形,所有的顶点都处于两条竖直辅助线之间,对应的轮廓特征都为空;该引脚沿着坐标轴X方向的投影Sz为多边形,两条竖直辅助线之外的所有顶点处于图7中的①、③区域。
同理,计算可得其他所有引脚的局部特征、分布特征和轮廓特征。
S6.3、基于多特征融合的方法进行引脚形状类型识别
以子组1代表的引脚为例,根据该引脚的形状、和/或分布特征、和/或局部特征、和/或轮廓特征来区分引脚所属的形状类型,其相关特征如下:
1)分布特征:在俯视图中引脚处于本体外轮廓线外侧且相连;
2)引脚形状:引脚为多边体;
3)轮廓特征:引脚沿着坐标轴X方向的投影形状Sx满足其两条竖直辅助线之外的所有顶点处于①、③区域。
满足J6引脚的判别标准,所以此引脚判定为J6类型的引脚。
同理,可判定其他剩余引脚类型均为J6。
S7、计算元器件安装平面
对于引脚类型为J6的贴装类引脚的元器件来说,元器件安装平面在引脚底部,获取在局部坐标系LocalCsys下的所有引脚的包围盒LocalPinListBox(minPnt(8.85,1.6,5.0),maxPnt(11.15,4.4,5.9)),元器件安装平面的z坐标值zCoord=LocalPinListBox.minPnt.z=5.0。
由上述计算可得安装平面上一点pcbPnt=(0.0,0.0,zCoord),将点pcbPnt转换到绝对坐标系WorldCsys中,得到在绝对坐标系WorldCsys下对应的点pcbPnt'=(0.0,0.0,5.0)。
将上述局部坐标系LocalCsys移动到安装平面上,局部坐标系LocalCsys的原点Origin=pcbPnt'=(0.0,0.0,5.0),局部坐标系LocalCsys的X、Y、Z坐标轴方向Vx、Vy、Vz保持不变。
S8、本体相关尺寸计算
计算子组7代表的立方体本体对应的尺寸信息。
具体的,上述步骤7中调整了局部坐标系的位置,在调整后的局部坐标系LocalCsys下,获取子组7代表的立方体本体的包围盒LocalBodyBox(minPnt(8.55,2.2,0.1),maxPnt(11.45,3.8,1.1)),长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,高H=LocalBodyBox.maxPnt.z-LocalBodyBox.minPnt.z=1.1–0.1=1.0,中心点Center=((8.55+11.45)/2,(2.2+3.8)/2,(0.1+1.1)/2)=(10.0,3.0,0.6)。
在局部坐标系LocalCsys下,计算所述本体上平行于坐标系LocalCsys的Z轴的通孔。
第一步,将所述本体沿着局部坐标系LocalCsys的Z轴方向投影,获取所有本体投影后的线段集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)}}和外轮廓线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)}},计算方法与步骤S5.2本体投影方法一致;
第二步,删除线段集Set”中的所包含的所有外轮廓线W”。
第三步,由于此模型不存在没有贯通本体的线段,故不需执行此删除线段集Set”中没有贯通本体的投影线段的步骤。
第四步,获取线段集Set”中首尾相连的线段,具体参考前述获取线段集Set”中首尾相连的的具体过程。
第五步,获取所有内轮廓。最终得到截面集合序列S截面={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)}}},截面集合序列S截面只包含一个子集合,即只有一个截面形状。
第六步,通过步骤S5.2中第三步形状判别方法,可得上述截面形状为圆形,同时可得圆形通孔的截面圆心Center截面=(11.05,3.5,0.0),R截面=0.1。
S9、引脚计算
在局部坐标系LocalCsys下,根据步骤6计算所得到的引脚形状类型J6,依次计算每个引脚的尺寸信息,以子组1代表的引脚为例,计算过程如下:
第一步,调整局部坐标系localCsys。计算引脚边界和本体边界的最短距离,可得引脚距离本体下边界距离为0,此引脚所属第Ⅳ区域,如图5,根据坐标系位姿调整规则,局部坐标系LocalCsys的X轴绕Z轴逆时针(从z轴正向往z轴负向看)旋转180°;
第二步,在最新的(经上述步骤调整后)局部坐标系LocalCsys下,获取引脚的包围盒J6Box(minPnt(-9.25,-4.4,0),maxPnt(-8.85,-3.8,0.9));
第三步,基于包围盒J6Box,计算J6引脚的尺寸A=J6Box.maxPnt.x–J6Box.minPnt.x=-8.85–(-9.25)=0.4,尺寸D=J6Box.maxPnt.z–J6Box.minPnt.z=0.9–0=0.9,中心点Center=((-9.25+(-8.85))/2,(-4.4+(-3.8))/2,(0+0.9)/2)=(-9.05,-4.1,0.45);
第四步,遍历J6引脚所有法向量平行于坐标系Z轴的平面,依次计算每一个平面,直到找到J6引脚的底面,计算方法如下:首先获取平面上一点pnt和面的单位法向量vec,如果法向量vec平行于坐标系Z轴方向向量Vz且方向相反,并且满足pnt.z=J6Box.minPnt.z,则此平面为J6引脚的底面bottomFace。计算上述方法得到的底面bottomFace的包围盒bottomBox(minPnt(-9.25,-4.4,0),maxPnt(-8.85,-4.15,0)),J6引脚的尺寸B=bottomBox.maxPnt.y–bottomBox.minPnt.y=-4.15–(-4.4)=0.25;
第五步,遍历J6引脚所有的与底面bottomFace平行且法向量相反的平面,取距离底面最近的平面作为J6引脚的背面backface,获取背面backface的包围盒backBox(minPnt(-9.25,-4.4,0.15),maxPnt(-8.85,-4.15,0.15)),则J6引脚的尺寸C=backBox.maxPnt.z-bottomBox.maxPnt.z=0.15。
第六步,还原局部坐标系LocalCsys到第一步调整之前的姿态,并且将第三步计算所得中心点转换到此时的局部坐标系LocalCsys中,得到最新的J6引脚的中心点Center=(9.05,4.1,0.45);
同理,根据上述计算方法可得其他引脚的尺寸信息。
S10、根据该元器件实物信息进行属性赋值:
S10.1、给模型整体赋属性值:封装名称=SOT-23-5,封装类型=SOT,制造商=XXX,料号=XXX,质量=25mg,功耗=350mW,湿敏等级=1。
S10.2、给本体赋属性值:颜色:黑色,材质:酚醛树脂,制造公差:±0.10。
S10.3、给引脚赋属性值:颜色:灰色,材质:纯雾锡镀层,安装类型:SMD(贴片 式),电气属性:电气式,制造公差:±0.10。
S11、模型参数输出(本实施例所涉及尺寸的单位均为毫米)
表1:本体数据
Figure PCTCN2022109345-appb-000001
表2:通孔数据
名称 形状 半径 圆心
通孔1 圆形 0.1 11.05,3.5,0.0
表3:引脚数据
Figure PCTCN2022109345-appb-000002
实施例三
请参见图19,图19是本发明实施例提供的一种元器件建模及模型参数化***的结构示意图。该元器件建模及模型参数化***,包括:
获取模块,用于获取元器件模型数据;
拆分聚类模块,用于根据所述模型数据中的信息,对元器件模型进行拆分聚类;
序列集生成模块,根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,所述本体序列集中包含各个本体包围盒,所述引脚序列集中包含各个引脚的包围盒;
识别模块,用于分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;
尺寸计算模块,用于基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;
输出模块,用于输出参数化模型数据。
本实施例提供的元器件建模及模型参数化***,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
实施例四
请参见图20,图20是本实施例提供的一种电子设备的结构示意图。该电子设备1100,包括:处理器1101、通信接口1102、存储器1103和通信总线1104,其中,处理器1101,通信接口1102,存储器1103通过通信总线1104完成相互间的通信;
存储器1103,用于存储计算机程序;
处理器1101,用于执行计算机程序时,实现上述方法步骤。
处理器1101执行计算机程序时实现以上实施例一和实施例二中的部分或全部步骤。
本发明实施例提供的电子设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
实施例五
本实施例提供了一种计算机可读存储介质,其上存储有计算机程序,上述计算机程序被处理器执行时实现以上实施例一和实施例二中的部分或全部步骤。
本发明实施例提供的计算机可读存储介质,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
本领域技术人员应明白,本申请的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式,这里将它们都统称为“模块”或“***”。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过Internet或其它有线或无线电信***。
在本发明的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。此外,本领域的技术人员可以将本说明书中描述的不同实施例或示例进行接合和组合。
以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。

Claims (20)

  1. 一种元器件建模及参数化的方法,其特征在于,包括:
    获取元器件模型数据;
    根据所述模型数据中的信息,对元器件模型进行拆分聚类;
    根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,所述本体序列集中包含各个本体包围盒,所述引脚序列集中包含各个引脚的包围盒;
    分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;
    基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;
    输出参数化模型数据。
  2. 根据权利要求1所述的元器件建模及参数化的方法,其特征在于,根据所述模型数据中的信息,对元器件模型进行拆分聚类,包括:
    基于所述模型数据中面的颜色信息划分的num个组得到若干个子组,以根据所有所述子组得到序列集List,其中,每个所述子组包括:单个零件的所有面、或若干颜色相同且外轮廓相连的面,所述序列集List包括若干按照预设顺序排列的所述子组。
  3. 根据权利要求2所述的元器件建模及参数化的方法,其特征在于,基于所述模型数据中面的颜色信息划分的num个组得到若干个子组,以根据所有所述子组得到序列集List,包括:
    根据所述模型数据中面的颜色信息将所有的面进行分组,得到num个组;
    当num>1、或者num=1且模型类型为零件时,将每个所述组中所有的面依据外轮廓相连的原则划分为若干个所述子组,当num=1且模型类型为装配时,将各个零件分别分入不同的子组;
    提取每个所述子组中每个面的轮廓点;
    根据所述轮廓点中x、y和z的最大坐标值和最小坐标值得到所述包围盒的体积;
    根据所述包围盒体积的大小将所有的所述子组进行排序,以得到排序结果;
    基于所述排序结果,根据第i个所述包围盒和第i个所述包围盒之后的各个包围盒的包含关系得到所述序列集List。
  4. 根据权利要求3所述的元器件建模及参数化的方法,其特征在于,基于所述排序结果,根据第i个所述包围盒和第i个所述包围盒之后的各个包围盒的包含关系得到所述序列集List,包括:
    基于所述排序结果,分别判断第i个所述包围盒和第i个所述包围盒之后的各个包围盒的坐标值的关系,若第i个所述包围盒的最小x、y和z坐标值均对应小于或者等于第j个所述包围盒的最小x、y和z坐标值,且第i个所述包围盒的最大x、y和z坐标值均对应大于或者等于第j个所述包围盒的最大x、y和z坐标值,则第i个所述包围盒包含第j个所述包围盒,将第j个所述包围盒及第j个所述包围盒对应的所述子组删除,以得到所述序列集List,其中,第j个所述包围盒为第i个所述包围盒之后的任意一个包围盒。
  5. 根据权利要求1所述的元器件建模及参数化的方法,其特征在于,根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,包括:
    根据第一体积比r1、第二体积比r2得到本体序列集和引脚序列集,r1=Vbox/Vmax,r2=Vmin/Vbox,Vbox为当前待区分的子组包围盒的体积,Vmax为最大包围盒的体积,Vmin为最小包围盒的体积;其中,体积最大的所述包围盒的子组为本体,体积最小的所述包围盒的子组为引脚。
  6. 根据权利要求5所述的元器件建模及参数化的方法,其特征在于,根据第一体积比r1、第二体积比r2得到本体序列集和引脚序列集,包括:
    判断所述第一体积比r1和所述第二体积比r2的关系,若所述第一体积比r1大于或者等于所述第二体积比r2,则当前待区分的子组为本体,否则当前待区分的子组为引脚,直至区分完所有子组,得到所述本体序列集和所述引脚序列集。
  7. 根据权利要求1所述的元器件建模及参数化的方法,其特征在于,分别判断所述本体和引脚的形状,并识别所述引脚的形状类型,包括:
    将所述本体序列集中每个本体沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到所述本体的形状;
    将所述引脚序列集中每个引脚沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到所述引脚的形状,并识别所述引脚所属的形状类型。
  8. 根据权利要求7所述的元器件建模及参数化的方法,其特征在于,所述局部坐标系的建立方法为:
    在绝对坐标系中,获取从所有引脚的中心指向所有本体的中心的向量zV(vx,vy,vz);
    判断所有所述引脚的包围盒沿坐标轴X、Y和Z方向的投影是否有重叠,若某方向无重叠,则将该方向对应的向量zV的坐标值添入序列集Vlist,且所述序列集Vlist按坐标值的绝对值从大到小的顺序对所述坐标值进行排序,其中,当所述坐标值的绝对值相同时,排序的优先级顺序为vz、vy、vx。
    选取所述序列集Vlist中第一个坐标值对应的方向作为局部坐标系Z轴的方向;
    基于所述序列集Vlist中第一个坐标值的正负,确定局部坐标系Z轴方向相对于绝对坐标系WorldCsys对应坐标轴的正反。
  9. 根据权利要求8所述的元器件建模及参数化的方法,其特征在于,将所述本体序列集中每个本体沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到所述本体的形状,包括:
    将所述本体沿着所述局部坐标系的X、Y、Z轴方向分别进行投影,以得到X、Y、Z轴方向的三个第一投影形状;
    根据三个所述第一投影形状判断所述本体的形状,若三个所述第一投影形状均为矩形,则所述本体的形状为立方体;若三个所述第一投影形状中的一个为圆形,则所述本体的形状为圆柱体;其余所述本体的形状均为多边体。
  10. 根据权利要求8所述的元器件建模及参数化的方法,其特征在于,将所述引脚序列集中每个引脚沿局部坐标系的X、Y和Z轴方向分别进行投影,以得到所述引脚的形状,并识别所述引脚所属的形状类型,包括:
    将所述引脚序列集中的每个所述引脚沿着所述局部坐标系的X、Y、Z轴方向分别进行投影,以得到X、Y、Z轴方向的三个第二投影形状;
    根据三个所述第二投影形状判断所述引脚的形状,首先,若三个所述第二投影形状均为矩形,则所述引脚的形状为立方体;其次,若三个所述第二投影形状均为圆形,则所述引脚的形状为球体;再次,若三个所述第二投影形状中的一个为圆形,则所述引脚的形状为圆柱体;最后,其余所述引脚的形状均为多边体;
    计算每个引脚在元器件俯视图中的分布特征,将在所述俯视图中所述引脚与所述本体的位置关系作为所述引脚的分布特征;
    基于所述局部坐标系,分别计算每个引脚与所有所述本体在X、Y和Z轴上的重叠长度,基于所述重叠长度分别计算本体重叠度和引脚重叠度,以将该所述本体重叠度和所述引脚重叠度作为所述引脚的局部特征;
    根据所述引脚的三个第二投影形状,分别得到每个投影的轮廓特征;
    根据所述引脚的形状和/或所述分布特征和/或所述局部特征和/或所述轮廓特征,区分所述引脚所属的形状类型。
  11. 根据权利要求10所述的元器件建模及参数化的方法,其特征在于,计算每个引脚在元器件俯视图中的分布特征,将在所述俯视图中所述引脚与所述本体的位置关系作为所述引脚的分布特征,包括:
    获取所述本体沿Z轴方向投影的外轮廓线和所述引脚沿Z轴方向投影的外轮廓点;
    判断所述引脚的外轮廓点与所述本体的外轮廓线的位置关系,若所述引脚外轮廓点全部在本体外轮廓线上,则视为引脚处于所述本体的外轮廓线内;其余均依据引脚外轮廓点在本体外轮廓线内或外轮廓线外,且忽略在本体外轮廓线上的点,基于剩余的点判断引脚的外轮廓点与本体外轮廓线的位置关系:
    若所述引脚的剩余外轮廓点都处于所述本体的外轮廓线内,则该所述引脚的外轮廓点处于所述本体的外轮廓线内;
    若所述引脚的剩余外轮廓点都处于所述本体的外轮廓线外,则该所述引脚的外轮廓点处于所述本体的外轮廓线外;
    若所述引脚剩余的部分外轮廓点处于所述本体的外轮廓线外且所述引脚剩余的部分外轮廓点处于所述本体的外轮廓线内,则该所述引脚与所述本体相交。
  12. 根据权利要求10所述的元器件建模及参数化的方法,其特征在于,基于所述重叠长度分别计算本体重叠度和引脚重叠度,以将该所述本体重叠度和所述引脚重叠度作为所述引脚的局部特征,包括:
    基于预设轴,选取所有所述本体的包围盒的坐标值的最小值与当前引脚的包围盒的坐标值的最小值中的较大值作为D1,选取所述本体的包围盒的坐标值的最大值与当前引脚的包围盒的坐标值的最大值中的较小值作为D2;
    判断D1和D2的关系,若D1≥D2,则在所述预设轴上所述本体重叠度和所述引脚重叠度均为0,若D1<D2,所述本体重叠度为overLen/(body1-body2),所述引脚重叠度为overLen/(pin1-pin2),其中,body1和body2分别为在所述预设轴上所述本体的包围盒的坐标值的最大值和最小值,pin1和pin2分别为在所述预设轴上所述引脚的包围盒的坐标值的最大值和最小值,overLen为重叠长度。
  13. 根据权利要求10所述的元器件建模及参数化的方法,其特征在于,根据所述引 脚的三个第二投影形状,分别得到每个投影的轮廓特征,包括:
    基于预设轴,通过过所述引脚投影形状的中心做水平辅助线Guid1,得到水平辅助线Guid1与所述引脚投影形状的两个交点;
    经过两个所述交点做两条竖直辅助线Guid2、Guid3,其中,竖直辅助线Guid3处于竖直辅助线Guid2的右侧;
    判断所述引脚投影的顶点与水平辅助线Guid1、竖直辅助线Guid2、Guid3的关系,若所述顶点在所述水平辅助线Guid1之上且处于所述竖直辅助线Guid3右侧,则所述顶点处在第一区域,若所述顶点在所述水平辅助线Guid1之上且处于所述竖直辅助线Guid2左侧,则所述顶点处在第二区域,若所述顶点在所述水平辅助线Guid1之下且处于所述竖直辅助线Guid2左侧,则所述顶点处在第三区域,若所述顶点在所述水平辅助线Guid1之下且处于所述竖直辅助线Guid3右侧,则所述顶点处在第四区域,将所述竖直辅助线Guid2和所述竖直辅助线Guid3两侧的所有所述顶点所处的区域构成的组合作为所述引脚投影的轮廓特征,其中,当所有顶点处于竖直辅助线Guid2和竖直辅助线Guid3上或/和之间时,则所述轮廓特征为空。
  14. 根据权利要求9或10所述的元器件建模及参数化的方法,其特征在于,投影形状判断方法包括:
    遍历所述本体或所述引脚所有的边,按长度离散化所有的边,得到线段集Set;
    依次将所述线段集Set中的线段沿着预设方向投影到坐标系平面上,得到投影后的线段集Set',所述预设方向包括X、Y和Z轴方向;
    根据线段集Set'的外轮廓线的顶点得到轮廓面积S、最小外接矩形的面积S 矩形和最小外接圆的面积S
    根据r 矩形、r 矩形的面积比阀值K、r 和r 的面积比阀值K1判断投影形状,若r 矩形>r 且r 矩形>K,则投影形状为矩形,若r >r 矩形且r >K1,则投影形状为圆形,否则投影形状为多边形,其中,r 矩形=S/S 矩形,r =S/S
  15. 根据权利要求14所述的元器件建模及参数化的方法,其特征在于,所述线段集Set'的外轮廓线的顶点的获取方法包括:
    依次判断所述线段集Set'中的每一条线段与其他线段是否相交,若有交点且交点不在该所述线段的端点,则将所述线段从交点处分割;
    基于分割后的所有线段,将具有相同顶点的线段归为一组,且两个端点都相同的线段仅保留一个线段;
    将所有顶点均投影至X轴上,基于投影之后的点,在X轴上选取间距最大的两个相邻点,以两个相邻点在X轴的坐标值的中点做垂直于X轴的直线;
    获取所述直线与所述线段集Set'中所有的线段的交点的Y轴坐标的最小值;
    取具有最小Y轴坐标值的交点的线段作为外轮廓线的起始线段,以该线段的一端顶点为起点pstart,另一端顶点为终点pend;
    遍历所述线段集Set'中线段的顶点与所述起始线段的终点pend坐标值相同的所有线段,选取与所述起始线段夹角最大的一条线段作为新的起始线段,将新的起始线段的另一端顶点作为新的终点pend,循环迭代,直到新的终点pend坐标等于起点pstart坐标, 则迭代结束,以此确定所述外轮廓线的线段及所述外轮廓线的顶点。
  16. 根据权利要求1所述的元器件建模及参数化的方法,其特征在于,所述元器件建模及参数化的方法还包括:
    根据所述引脚包围盒和所述本体包围盒中的至少一项、以及引脚类型确定安装平面,将所述局部坐标系移动到安装平面上。
  17. 根据权利要求1所述的元器件建模及参数化的方法,其特征在于,所述元器件建模及参数化的方法还包括:计算所有所述本体上平行于局部坐标系的预设轴的通孔,其中,
    基于所述局部坐标系,将所有所述本体沿着局部坐标系的预设轴方向投影,得到所有所述本体投影后的第一线段集Set”;
    删除所述第一线段集Set”中的外轮廓线,得到第二线段集Set”;
    删除所述第二线段集Set”中没有贯通所述本体的投影线段,得到第三线段集Set”;
    从所述第三线段集Set”中选择首尾相连的线段,得到第四线段集Set”,所述第四线段集Set”中包括若干通孔的截面形状。
  18. 一种元器件建模及模型参数化***,其特征在于,包括:
    获取模块,用于获取元器件模型数据;
    拆分聚类模块,用于根据所述模型数据中的信息,对元器件模型进行拆分聚类;
    序列集生成模块,根据所述拆分聚类的结果,区分所述元器件模型的本体和引脚,得到本体序列集和引脚序列集,所述本体序列集中包含各个本体包围盒,所述引脚序列集中包含各个引脚的包围盒;
    识别模块,用于分别判断所述本体和引脚的形状,并识别所述引脚的形状类型;
    尺寸计算模块,用于基于所述本体的形状及本体的包围盒得到所述本体尺寸,基于所述引脚的形状、形状类型及引脚的包围盒得到所述引脚的尺寸;
    输出模块,用于输出参数化模型数据。
  19. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时,实现权利要求1-17任一项所述的方法步骤。
  20. 一种存储介质,其特征在于,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-17任一项所述的方法步骤。
PCT/CN2022/109345 2021-12-09 2022-08-01 元器件建模及参数化的方法、***、电子设备及存储介质 WO2023103415A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111503423.1A CN114491922A (zh) 2021-12-09 2021-12-09 元器件建模及参数化的方法、***、电子设备及存储介质
CN202111503423.1 2021-12-09

Publications (1)

Publication Number Publication Date
WO2023103415A1 true WO2023103415A1 (zh) 2023-06-15

Family

ID=81492190

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/109345 WO2023103415A1 (zh) 2021-12-09 2022-08-01 元器件建模及参数化的方法、***、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114491922A (zh)
WO (1) WO2023103415A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118131879A (zh) * 2024-04-30 2024-06-04 苏州元脑智能科技有限公司 Psu供电装置及供电控制方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114491922A (zh) * 2021-12-09 2022-05-13 上海望友信息科技有限公司 元器件建模及参数化的方法、***、电子设备及存储介质
CN114997093B (zh) * 2022-06-02 2024-04-26 南京维拓科技股份有限公司 一种仿真数字化模型器件引脚快速生成线的方法
CN115205485B (zh) * 2022-06-30 2023-03-24 广州极点三维信息科技有限公司 基于包围盒的三维空间探测扩充方法、***、装置及介质
CN115169276B (zh) * 2022-07-22 2023-04-07 北京云枢创新软件技术有限公司 一种基于叠放模块的引脚区域匹配方法
CN115935897A (zh) * 2022-12-05 2023-04-07 上海望友信息科技有限公司 Pcba载板模型生成方法、***、电子设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107610221A (zh) * 2017-09-11 2018-01-19 南京大学 一种基于同构模型表示的三维模型生成方法
US20190250580A1 (en) * 2018-02-09 2019-08-15 Dassault Systemes Designing a part manufacturable by milling operations
CN110795797A (zh) * 2019-09-26 2020-02-14 北京航空航天大学 一种mbd模型加工特征识别及信息提取方法
CN112822939A (zh) * 2021-02-03 2021-05-18 上海望友信息科技有限公司 一种电子元器件成型方法、***、电子设备及存储介质
CN112862951A (zh) * 2021-01-28 2021-05-28 晟通科技集团有限公司 配件建模方法、计算机装置及存储介质
WO2021174660A1 (zh) * 2020-03-04 2021-09-10 杭州群核信息技术有限公司 一种基于云的通用参数化模型解析方法及设计***
CN114491922A (zh) * 2021-12-09 2022-05-13 上海望友信息科技有限公司 元器件建模及参数化的方法、***、电子设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107610221A (zh) * 2017-09-11 2018-01-19 南京大学 一种基于同构模型表示的三维模型生成方法
US20190250580A1 (en) * 2018-02-09 2019-08-15 Dassault Systemes Designing a part manufacturable by milling operations
CN110795797A (zh) * 2019-09-26 2020-02-14 北京航空航天大学 一种mbd模型加工特征识别及信息提取方法
WO2021174660A1 (zh) * 2020-03-04 2021-09-10 杭州群核信息技术有限公司 一种基于云的通用参数化模型解析方法及设计***
CN112862951A (zh) * 2021-01-28 2021-05-28 晟通科技集团有限公司 配件建模方法、计算机装置及存储介质
CN112822939A (zh) * 2021-02-03 2021-05-18 上海望友信息科技有限公司 一种电子元器件成型方法、***、电子设备及存储介质
CN114491922A (zh) * 2021-12-09 2022-05-13 上海望友信息科技有限公司 元器件建模及参数化的方法、***、电子设备及存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GAO WEI-GUO, NIU WEN-TIE, ZHANG DA-WEI: "Information modeling of special module design oriented general module parts", JOURNAL OF MACHINE DESIGN., vol. 27, no. 6, 20 June 2010 (2010-06-20), pages 8 - 13, XP093071531, DOI: 10.13841/j.cnki.jxsj.2010.06.015 *
ZHOU SHUN-MAN, LIU SU-JIE, ZHANG YUAN: "Study on Modeling for Low Frequency Electronic Parts Based on ADS", GUIDANCE & FUZE., vol. 34, no. 2, 1 June 2013 (2013-06-01), pages 49 - 53, XP093071546 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118131879A (zh) * 2024-04-30 2024-06-04 苏州元脑智能科技有限公司 Psu供电装置及供电控制方法

Also Published As

Publication number Publication date
CN114491922A (zh) 2022-05-13

Similar Documents

Publication Publication Date Title
WO2023103415A1 (zh) 元器件建模及参数化的方法、***、电子设备及存储介质
CN107045526B (zh) 一种电子建筑施工图的图形识别方法
CN110245368B (zh) 一种bim数据的结构化处理与存储方法
CN107545025B (zh) 利用形态学标准查询数据库
CN107767453B (zh) 一种基于规则约束的建筑物lidar点云重构优化方法
CN102682103A (zh) 一种面向海量激光雷达点云模型的三维空间索引方法
US8600713B2 (en) Method of online building-model reconstruction using photogrammetric mapping system
US9971335B2 (en) Hybrid dynamic tree data structure and accessibility mapping for computer numerical controlled machining path planning
CN113888716B (zh) 一种面向数字孪生的场景轻量化方法
CN111460193B (zh) 一种基于多模态信息融合的三维模型分类方法
CN113001551B (zh) 基于八叉树结构分割的快速碰撞检测方法
CN113609599B (zh) 一种飞行器湍流绕流模拟的壁面距有效单元计算方法
CN111339599A (zh) 一种bim模型到gis模型的转换方法
CN115661374A (zh) 一种基于空间划分和模型体素化的快速检索方法
Xú et al. STEP-NC based reverse engineering of in-process model of NC simulation
CN115713605A (zh) 一种基于图像学习的商业类建筑群自动建模方法
CN115641406A (zh) 一种电力线激光点云数据部分重合分段及聚类方法
CN111243094A (zh) 一种基于点灯法的三维模型精确体素化方法
Leng et al. Rapid simplification of 3D geometry model of mechanisms in the digital twins-driven manufacturing system design
CN111915720B (zh) 一种建筑物Mesh模型到CityGML模型的自动转换方法
Su et al. Slibo-net: Floorplan reconstruction via slicing box representation with local geometry regularization
Jia et al. Machining feature recognition method based on improved mesh neural network
KR20210108546A (ko) 반도체 설계 시뮬레이션을 위한 명령들을 실행하는 컴퓨터 시스템으로 구현된 방법
Yang et al. A 3D nesting method based on the convex-concave coding similarity of the voxelized model for additive manufacturing
Ji et al. Point cloud segmentation for complex microsurfaces based on feature line fitting

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22902849

Country of ref document: EP

Kind code of ref document: A1