Method, device, equipment and medium for inspecting height of printed circuit board component
By employing a two-level intersection judgment mechanism of coarse screening with outer frame and fine judgment with Boolean intersection, the problems of low efficiency and high false judgment rate in the height inspection of printed circuit board components are solved, and rapid and accurate height violation judgment is achieved.
Patent Information
- Application Number
- CN202611482078.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-20
AI Technical Summary
In the existing technology, the height inspection of printed circuit board components is inefficient and has a high misjudgment rate. It is impossible to quickly and accurately determine whether the height limit area is exceeded, which may lead to assembly interference or damage.
A two-level intersection determination mechanism is adopted, from coarse screening of the outer frame to fine judgment of Boolean intersection. By acquiring printed circuit board design data, the outer frame is determined and intersection judgment is performed. Combined with Boolean intersection conditions, it is determined whether there is a violation of height limit.
It improves inspection efficiency and judgment accuracy, ensuring that height violations are only judged when there is actual spatial overlap, avoiding misjudgment, and achieving fast and accurate component height inspection.
Smart Images

Figure CN123139933A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of printed circuit board design, and more particularly to a method, apparatus, equipment, and medium for inspecting the height of components on a printed circuit board. Background Technology
[0002] As electronic devices become increasingly miniaturized and denser, the layout of components on printed circuit boards (PCBs) is becoming more compact, and the spatial relationships between components and structural parts are becoming more complex. In fields such as automotive electronics and consumer electronics, PCBs typically need to be installed within limited spaces. If the height of components exceeds the structural height limit, it may lead to assembly interference or even damage. Therefore, how to effectively check the height of PCB components during the design phase has become a continuously important technical focus in the field of PCB design.
[0003] In related technologies, manual measurement is typically used, or design software is employed to simply check whether the area falls within a height restriction zone. These solutions suffer from low inspection efficiency and insufficient accuracy in judgment.
[0004] Therefore, how to quickly and accurately check whether printed circuit board components violate height restrictions by exceeding the height limit area has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for inspecting the height of components on printed circuit boards. It aims to solve the problems of low inspection efficiency or high false judgment rate in related technologies by using a two-level intersection judgment mechanism, from coarse screening of the outer frame to fine judgment of Boolean intersection, thereby improving the inspection efficiency and judgment accuracy of violations of height restrictions on printed circuit board components.
[0006] In a first aspect, embodiments of this application provide a method for checking the height of components on a printed circuit board, comprising: acquiring design data of the printed circuit board, the design data including planar contours and height attribute values of multiple components, and bottom contours and height limits of multiple height-limited regions; determining the bounding box of the component to be checked and its planar contour; the component to be checked is determined based on multiple components, wherein the edge complexity of the bounding box of the planar contour is less than the edge complexity of the planar contour; when the intersection result of the bounding box of the planar contour of the component to be checked and the bounding box of the bottom contour of the candidate height-limited region satisfies a first intersection condition, determining the component to be checked as a target component and the candidate height-limited region as a target height-limited region; the candidate height-limited region is determined based on multiple height-limited regions; when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited region satisfies a second intersection condition, determining whether the target component violates the height limit of the target height-limited region based on the height attribute value of the target component and the height limit value of the target height-limited region.
[0007] Based on the aforementioned technical means, this method for checking the height of printed circuit board components first acquires printed circuit board design data containing the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-limited regions, providing a complete and necessary data foundation for subsequent height checks. Secondly, it determines the bounding box of the component to be checked and its planar contour, ensuring that the edge complexity of this bounding box is less than that of the planar contour, reducing the computational complexity of subsequent geometric intersection judgments and thus improving inspection efficiency. Then, the target component and target height-limited region are determined only when the intersection result between the bounding box of the component to be checked and the bounding box of the bottom contour of the candidate height-limited region satisfies the first intersection condition. This allows for rapid filtering of potentially intersecting height-limited regions, avoiding complex and precise calculations for each height-limited region, further improving inspection speed. Next, only when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area satisfies the second intersection condition is the height attribute value and the height limit value used to determine whether a height restriction violation exists. This ensures that only components and height-limited areas that actually overlap in space are included in the height violation judgment, effectively avoiding misjudgments caused by overlapping outer frames without actual intrusion, and improving the accuracy of the judgment. Finally, since the height comparison is based on the height attribute value of the target component and the height limit value of the target height-limited area only after confirming that the Boolean intersection satisfies the second intersection condition, the violation can be accurately judged based on the actual overlapping area and height limit, ensuring the reliability of the inspection results. In summary, this application, through a two-level intersection judgment mechanism from coarse screening of outer frames to fine judgment of Boolean intersection, balances inspection efficiency and judgment accuracy, solves the problems of low inspection efficiency or high misjudgment rate in related technologies, and improves the inspection efficiency and reliability of height restriction violations of printed circuit board components.
[0008] In one possible implementation, determining whether the target component violates the height limit by exceeding the target height limit based on the height attribute value of the target component and the height limit value of the target height-limited area includes: determining the Boolean intersection region of the planar contour of the target component and the bottom contour of the target height-limited area; determining the corresponding height limit value in the height limit mapping model for each position coordinate in the Boolean intersection region; the height limit mapping model includes all position coordinates and their corresponding height limit values within the bottom contour of the target height-limited area; if the height limit value corresponding to each position coordinate in the Boolean intersection region is greater than or equal to the height attribute value of the target component at the position coordinate, it is determined that the target component does not violate the height limit by exceeding the target height limit; otherwise, it is determined that the target component violates the height limit by exceeding the target height limit.
[0009] Based on the above technical means, the corresponding height limit value is determined and compared for each location coordinate within the Boolean intersection area. This can adapt to complex scenarios where the height limit value changes with location within the height limit area, achieve refined height violation judgment, and avoid false alarms or missed alarms caused by using a uniform height limit value. As long as there is a height limit value corresponding to a location coordinate that is less than the height attribute value, a violation is judged. This can sensitively capture local excessive height situations and ensure that no interference risks are overlooked.
[0010] In one possible implementation, the method further includes: determining the center point coordinates of the target component; and determining that the target component violates the height restriction by exceeding the target height restriction area if the center point coordinates are located within the bottom contour of the target height restriction area and the height restriction value corresponding to the center point coordinates is less than the height attribute value of the target component.
[0011] Based on the above technical means, when it is impossible to obtain the planar contour or high-precision Boolean operations are not required, the center point coordinates are used for judgment. This can quickly determine whether the target component may exceed the height limit area with a small amount of calculation, ensuring that no one is missed, while reducing the computational burden.
[0012] In one possible implementation, the design data also includes the mounting surface attributes of multiple components; the multiple components are divided into a top-mount component set and a bottom-mount component set based on their mounting surface attributes; the top-mount component set includes multiple components with the mounting surface attribute of top, and the bottom-mount component set includes multiple components with the mounting surface attribute of bottom; the method further includes: when a target component has a height restriction violation exceeding the target height limit area, and the target component belongs to the top-mount component set, adding the height restriction violation information of the target component to the top-mount violation result set; when a target component has a height restriction violation exceeding the target height limit area, and the target component belongs to the bottom-mount component set, adding the height restriction violation information of the target component to the bottom-mount violation result set; sorting the top-mount violation result set and the bottom-mount violation result set respectively, and displaying the sorted top-mount violation result set and bottom-mount violation result set in the top-view and bottom-view respectively.
[0013] Based on the above technical means, components are divided into top-mounted component sets and bottom-mounted component sets according to the mounting surface attributes. Violation information is then classified into the top-mounted violation result set and the bottom-mounted violation result set respectively, so that the inspection results of the two sides do not interfere with each other. The two result sets are sorted and displayed in the top-mounted inspection view and the bottom-mounted inspection view respectively, which makes it easier for designers to view the components side by side, prioritize the handling of serious violations, and improve inspection efficiency.
[0014] In one possible implementation, after determining that the target component violates the height restriction by exceeding the target height limit area, the method further includes: obtaining the height attribute status of the target component; the height attribute status is used to indicate whether the target component has a valid height attribute value; when the height attribute status of the target component is that it has a valid height attribute value, the height restriction violation of the target component is determined as a first type of violation; when the height attribute status of the target component is that it does not have a valid height attribute value, the height restriction violation of the target component is determined as a second type of violation; wherein, the first type of violation and the second type of violation correspond to different visual identifiers, and the warning level of the visual identifier corresponding to the first type of violation is higher than that of the visual identifier corresponding to the second type of violation.
[0015] Based on the above technical means, violations are divided into Type I violations and Type II violations, and each is given a visual label with different levels of warning. Designers can quickly distinguish between two different types of problems: "confirmed to be too high" and "missing height data to be confirmed". They can prioritize handling Type I violations with higher warning levels, thereby improving the efficiency of investigation and modification.
[0016] In one possible implementation, the first intersection condition includes: the projection range of the outer frame of the component to be inspected on the X-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the X-axis, and the projection range of the outer frame of the component to be inspected on the Y-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the Y-axis.
[0017] Based on the above technical means, the first intersection condition is determined by comparing whether the projection intervals of the bounding box on the X-axis and Y-axis overlap. The judgment process only involves the comparison of coordinate values, with little computational load. It can quickly filter out the height-limited areas that may intersect, avoiding the need to perform complex polygon Boolean operations on all height-limited areas and improving inspection efficiency.
[0018] In one possible implementation, the second intersection condition includes: the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area is non-empty.
[0019] Based on the above technical means, Boolean intersection operation is used to accurately determine the intersection between the planar contour of the target component and the bottom contour of the target height restriction area. This can accurately identify whether the target component actually intrudes into the height restriction area, effectively avoid false alarms caused by only overlapping outer frames without actual intrusion, and improve the accuracy of judgment.
[0020] Secondly, embodiments of this application provide a device for inspecting the height of components on a printed circuit board, comprising: a data acquisition module for acquiring design data of the printed circuit board, the design data including planar contours and height attribute values of multiple components, and bottom contours and height limits of multiple height-limited regions; a component determination module for determining the outer frame of the component to be inspected and its planar contour; the component to be inspected is determined based on multiple components, and the edge complexity of the outer frame is less than the edge complexity of the planar contour; an intersection judgment module for determining the component to be inspected as a target component and the candidate height-limited region as a target height-limited region when the intersection result of the outer frame of the component to be inspected and the outer frame of the bottom contour of the candidate height-limited region satisfies a first intersection condition; the candidate height-limited region is determined based on multiple height-limited regions; and a violation determination module for determining whether the target component violates the height limit of the target height-limited region when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited region satisfies a second intersection condition, based on the height attribute value of the target component and the height limit value of the target height-limited region.
[0021] Thirdly, this application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0022] Fourthly, this application provides a computer-readable storage medium storing a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method of the first aspect or any possible implementation thereof.
[0023] Fifthly, this application provides a computer program product, which includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method in the first aspect or any possible implementation thereof.
[0024] The second to fifth aspects described above correspond to the technical solutions of the first aspect of the embodiments of this application. The beneficial effects achieved by each aspect and its corresponding feasible implementation are similar, and will not be repeated here. It should be noted that various possible implementations of any aspect described above can be combined, provided that the solutions do not contradict each other. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of a PCB component height inspection system provided in an embodiment of this application; Figure 2 This application provides a schematic diagram of the structure of a height inspection server according to an embodiment of the present application. Figure 3 A flowchart illustrating an embodiment of a method for checking the height of components on a printed circuit board provided in this application. Figure 4 A flowchart illustrating a method for determining a high degree of violation, provided in an embodiment of this application; Figure 5 A flowchart illustrating a first inspection mode provided in an embodiment of this application; Figure 6 A flowchart illustrating a second inspection mode provided in an embodiment of this application; Figure 7 A schematic diagram of a device for checking the height of printed circuit board components provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Those skilled in the art will recognize that, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0027] Based on the aforementioned background technology, this application provides a method for checking the height of components on a printed circuit board. First, the acquired printed circuit board design data includes the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-limited regions, providing a complete and necessary data foundation for subsequent height checks. Second, the bounding box of the component to be checked and its planar contour is determined, and the edge complexity of this bounding box is less than that of the planar contour, reducing the computational complexity of subsequent geometric intersection judgments and thus improving inspection efficiency. Then, the target component and target height-limited region are determined only when the intersection result between the bounding box of the component to be checked and the bounding box of the bottom contour of the candidate height-limited region satisfies the first intersection condition. This allows for rapid filtering of potentially intersecting height-limited regions, avoiding complex and precise calculations for each height-limited region, further improving inspection speed. Next, only when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area satisfies the second intersection condition is the height attribute value and the height limit value used to determine whether a height restriction violation exists. This ensures that only components and height-limited areas that actually overlap in space are included in the height violation judgment, effectively avoiding misjudgments caused by overlapping outer frames without actual intrusion, thus improving the accuracy of the judgment. Finally, since the height comparison is based on the height attribute value of the target component and the height limit value of the target height-limited area only after confirming that the Boolean intersection satisfies the second intersection condition, the violation can be accurately judged based on the actual overlapping area and height limit, ensuring the reliability of the inspection results. In summary, this application, through a two-level intersection judgment mechanism from coarse screening of outer frames to fine judgment of Boolean intersection, balances inspection efficiency and judgment accuracy, solving the problems of low inspection efficiency or high misjudgment rate in related technologies, and improving the inspection efficiency and judgment accuracy of height restriction violations of printed circuit board components.
[0028] Figure 1 This is a schematic diagram of a PCB component height inspection system provided in an embodiment of this application. Figure 1 As shown, the PCB component height inspection system includes a height inspection server 101 and a design terminal 102. The height inspection server 101 and the design terminal 102 are communicatively connected.
[0029] It should be understood that the design terminal 102 stores or runs PCB design data, which includes the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-restricted areas. The height check server 101 can read the PCB design data from the design terminal 102 via a communication connection, obtain the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-restricted areas, and perform multi-level comparisons to determine whether there are any components that violate the height restrictions of the height-restricted areas.
[0030] As one possible implementation, a PCB can be a substrate used to carry and electrically connect multiple components, and it can be composed of an insulating substrate and conductive lines, including a top surface and a bottom surface. For example, a PCB can be at least one of the following: mobile phone PCB, automotive electronics PCB, consumer electronics PCB, industrial control PCB, communication equipment PCB, and computer motherboard. The PCB can be deployed in at least one of vehicle electronic equipment, consumer electronic equipment, industrial control equipment, communication equipment, and computer equipment.
[0031] In one possible implementation, the multiple components may include at least one of the following: resistors, capacitors, connectors, shielding covers, power modules, electrolytic capacitors, and chips, mounted on the top and / or bottom surfaces of the PCB. The multiple components may be deployed on the top surface, bottom surface, a partial area, or the entire board area of the PCB. In one implementation, the planar contours and height attribute values of each of the multiple components can be defined using a package library in the design terminal 102, and the multiple components can be mounted at corresponding positions on the PCB.
[0032] The terminal 102 can be at least one of a server, computer, workstation, laptop, or tablet computer, and this application does not specifically limit it.
[0033] As one possible implementation, the design terminal 102 is used to run electronic design automation (EDA) tools, determine the PCB design document, and send the PCB design data to the height inspection server 101 based on the design document. The EDA tools can be at least one of Cadence Allegro, Altium Designer, Mentor Graphics, Zuken, etc., and this application does not limit the scope of the application to this.
[0034] The high-altitude inspection server 101 can be a hardware device or a software module. Hardware devices include, but are not limited to, standalone computing devices and servers; standalone computing devices include at least one of desktop computers, laptops, workstations, and in-vehicle computing platforms; servers include at least one of local servers and cloud servers; software modules include computing modules integrated into electronic design automation tools.
[0035] For example, when the height inspection server 101 is a computing module integrated into the design software, it can be embedded as a plug-in or script module into electronic design automation tools, directly reading the PCB design data in the design terminal 102 and executing the height inspection method for printed circuit board components of this application, outputting the results of non-compliant components to the design interface; when the height inspection server 101 is a cloud server, it can connect to the design terminal 102 via a network, receive the design data uploaded by the design terminal 102, execute the height inspection method for printed circuit board components of this application in the cloud, and return the violation results to the design terminal 102 for display and navigation; when the height inspection server 101 is an in-vehicle computing platform, it can be deployed in the vehicle electronic system to perform height inspection on the design data of the in-vehicle PCB to determine whether components exceed the height limit of the height-limited structural component area. This application does not limit the specific form of the height inspection server 101.
[0036] In other embodiments, the height inspection server 101 and the design terminal 102 can be integrated into one device, that is, the height inspection server 101 acts as a computing module or processing unit in the design terminal 102, directly reading the design data in the design terminal 102 and executing the inspection method.
[0037] In summary, the PCB component height inspection system provided in this application reads design data from the design terminal 102 through the height inspection server 101. It can automatically obtain the planar contours and height attribute values of multiple components in the PCB design data, as well as the bottom contours and height limits of multiple height-limited areas corresponding to height-limited structural components. It then executes the PCB component height inspection method of any embodiment of this application to determine whether there are any components that exceed the height limit of the height-limited area. It eliminates the need for manual measurement and area-by-area comparison, thus improving inspection efficiency. The system improves the accuracy of judgment by making judgments based on the spatial intersection relationship between the planar contours of the components and the bottom contours of the height-limited areas.
[0038] It should be noted that the above description of the system architecture is only for clearly illustrating the PCB component height inspection system provided in the embodiments of this application, and does not constitute a limitation on the inspection system. Those skilled in the art will understand that, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems. This PCB component height inspection system may include more or fewer components than shown in the figures, or combine some components, or split some components, or adopt different component arrangement methods. The components shown in the figures can be implemented in hardware, software, or a combination of hardware and software.
[0039] Figure 2This is a schematic diagram of the structure of a height inspection server provided in an embodiment of this application, specifically... Figure 1 A possible structural diagram of a medium-to-high-level inspection server 101. (See diagram below.) Figure 2 As shown, the height inspection server 101 includes: an interactive interface module 201, a height restriction area definition module 202, a height data extraction module 203, a geometric intersection determination module 204, and a result visualization and navigation module 205. These modules are interconnected via data flow, forming a complete closed loop from height restriction area definition, height data acquisition, spatial intersection determination to result presentation and navigation.
[0040] The interactive interface module 201 provides a graphical interface, receives input of top and / or bottom height limits, triggers height checks, and displays a list of violation results and navigation controls. In one implementation, the interactive interface module 201 uses a dynamic form mechanism. A form definition file is generated in the runtime directory, and a graphical interface containing height limit threshold input boxes, top check controls, bottom check controls, shape area check controls, a double-sided result list, and navigation buttons is created using a form creation function. Temporary files are deleted after form creation.
[0041] The height restriction area definition module 202 is used to define height restriction areas in printed circuit board design data. In one implementation, the height restriction area definition module 202 obtains polygon shapes from the top and bottom height restriction layers, converts the polygon shapes into polygon geometric objects using a polygon conversion function, and obtains the top height restriction polygon set and the bottom height restriction polygon set, respectively.
[0042] The height data extraction module 203 is used to read the height attribute from the component package and parse the height attribute to obtain the height attribute value. In one implementation, the height data extraction module 203 reads the maximum height attribute string from the placeholder boundary layer of the component package, parses it to obtain the value and unit identifier, converts it to millimeters when the unit identifier is in mils, and directly uses it when the unit identifier is in millimeters, so as to achieve unit uniformity.
[0043] The geometric intersection determination module 204 performs a two-level intersection determination, including: when the intersection result of the outer frame of the component to be inspected and the outer frame of the bottom contour of the candidate height limit region satisfies the first intersection condition, determining that the component to be inspected is the target component and the candidate height limit region is the target height limit region; when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height limit region satisfies the second intersection condition, determining that the target component falls into the target height limit region. In one implementation, when the planar contour of the target component cannot be obtained, the geometric intersection determination module 204 performs a point inclusion determination based on the center point coordinates of the target component and the bottom contour of the target height limit region.
[0044] The result visualization and navigation module 205 is used to classify, color, sort, display faceted, and zoom in / out of violation results. In one implementation, the result visualization and navigation module 205 displays violation components with valid height attribute values that exceed the height limit using a first visual identifier, and violation components without valid height attribute values using a second visual identifier, with the first visual identifier having a higher warning level than the second visual identifier; it sorts the top and bottom violation result sets and displays them respectively in the top and bottom inspection views; in response to a selection operation on a result list item, it zooms the graphical view to the corresponding violation component and highlights it.
[0045] It should be noted that the above module division is only an illustrative example, and this application does not impose any specific limitations on it. The height inspection server 101 can be used to execute the printed circuit board component height inspection method of any embodiment of this application. For specific implementation, please refer to the following method embodiments. To avoid repetition, it will not be described again here.
[0046] The method for checking the height of printed circuit board components provided in this application will be described below with reference to specific embodiments. These embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0047] Figure 3 This is a flowchart illustrating an embodiment of a method for checking the height of components on a printed circuit board, provided in this application. (Refer to...) Figure 3 The method for checking the height of printed circuit board components provided in this application embodiment may include: S301. Obtain the design data of the printed circuit board.
[0048] The design data includes the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-restricted areas.
[0049] A printed circuit board (PCB) is a substrate used to carry and electrically connect electronic components. It can be composed of an insulating substrate and conductive lines, and the components are fixed to its surface by mounting or through-hole mounting.
[0050] Electronic components refer to electronic components mounted on printed circuit boards, including but not limited to resistors, capacitors, connectors, shielding covers, power modules, etc.
[0051] The planar profile of a component refers to the projected shape of the component on the printed circuit board surface. It can be represented by a polygon of the placeholder boundary (e.g., PLACE_BOUND) defined in the component package, which reflects the actual area of the board surface occupied by the component.
[0052] The height attribute value of a component refers to the maximum height of the component in the direction perpendicular to the surface of the printed circuit board. It can be recorded in the height attribute of the component package. For example, the PACKAGE_HEIGHT_MAX attribute is a string label.
[0053] The height-restricted area refers to the area where, after the printed circuit board is installed in the housing, the height of components is limited by height-restricted structural components, preventing them from exceeding a preset value. This area can be pre-defined on the printed circuit board according to structural drawings, and this application does not specifically limit it. The height-restricted structural components may include at least one of the following: housing, shielding cover, battery, antenna bracket, connector clearance structure, and inner wall of the housing, which are located above and / or below the PCB, and in partial or full areas of the board, forming a height-restricted space with the PCB.
[0054] The bottom outline of the height-restricted area refers to the projected shape of the height-restricted area on the printed circuit board surface. It can be represented in polygonal form and is used to define the planar range of the height-restricted area.
[0055] The height limit value of a height-restricted area refers to the upper limit constraint that the height of components is allowed in that area, which can be preset based on the structural space margin corresponding to that area. In one implementation, the height limit value can be a uniform height threshold within the height-restricted area; in another implementation, the height limit value can be multiple height thresholds corresponding to different locations within the height-restricted area, that is, the height limit values form a height restriction mapping relationship that varies with location.
[0056] For example, the above variables are obtained as follows: the planar outline of the component can be obtained by reading the shape on the placeholder boundary layer (such as the top surface mount component layer PLACE_BOUND_TOP or the bottom surface mount component layer PLACE_BOUND_BOTTOM) in the component package and converting it into a polygon; the height attribute value of the component can be obtained by reading the height attribute (such as PACKAGE_HEIGHT_MAX) carried on the component package and parsing its value and unit; the bottom outline of the height-limited area can be obtained by reading the shape on the height-limited layer (such as BOARD GEOMETRY / RESTRICT_TOP or BOARDGEOMETRY / RESTRICT_BOTTOM) and converting it into a polygon; the height limit value of the height-limited area can be obtained by inputting through the interface or reading the preset configuration.
[0057] Based on S301, since the acquired design data includes the planar contours of components and their height attribute values, as well as the bottom contours of height-limited areas and their height limits, it provides a complete and necessary data foundation for subsequent rough screening of outer frames, fine judgment of Boolean intersection, and determination of height violations.
[0058] S302. Determine the outer frame of the component to be inspected and its planar outline.
[0059] The component to be inspected is determined based on multiple components. As one possible implementation, since there are multiple components on the PCB, one component can be identified as the component to be inspected first, and its outer frame can be set.
[0060] In this embodiment, the edge complexity of the bounding box of the planar contour is less than the edge complexity of the planar contour.
[0061] It should be understood that the planar contours of components are usually irregular polygons with a large number of sides. If the intersection of the planar contour with the bottom contour of the height-restricted area is directly determined, polygon Boolean operations must be performed, resulting in a large amount of computation. In contrast, the circumscribed frame is a simple geometric shape that encloses the planar contour. It has fewer sides and a regular shape, and the intersection determination can be completed simply by comparing the coordinate range, significantly reducing the computational complexity. Therefore, using the circumscribed frame with lower side complexity for coarse screening can quickly eliminate obviously non-intersecting components and height-restricted areas, reducing the number of subsequent precise intersection calculations and thus improving the overall inspection efficiency.
[0062] As one possible implementation, the bounding box of the planar contour of the component to be inspected can be determined directly using geometric functions provided by Electronic Design Automation (EDA) tools. For example, in the Cadence Allegro platform, the bBox property of the component symbol can be read. This property is the bounding rectangle of the component's planar contour in the board coordinate system, defined by the minimum X-coordinate, minimum Y-coordinate, maximum X-coordinate, and maximum Y-coordinate.
[0063] As another possible implementation, the bounding box of the planar contour of the component to be inspected can be determined by traversing the coordinates of all vertices of the component's planar contour, calculating the minimum and maximum values of all vertices in the X-axis direction and the Y-axis direction, and constructing a rectangle as the bounding box using these four values. The rectangle's interval in the X-axis direction is [minimum X, maximum X], and its interval in the Y-axis direction is [minimum Y, maximum Y], thus completely enclosing the planar contour.
[0064] Based on S302, since the bounding box of the component to be inspected and its planar contour is determined, and the edge complexity of the bounding box is less than that of the edge complexity of the planar contour, a simplified geometric object is provided for the subsequent judgment of the first intersection condition. This eliminates the need to directly process complex polygons in the intersection judgment, reduces computational complexity, and thus improves inspection efficiency.
[0065] S303. When the intersection result of the outer frame of the planar contour of the component to be inspected and the outer frame of the bottom contour of the candidate height limit area satisfies the first intersection condition, the component to be inspected is determined to be the target component and the candidate height limit area is determined to be the target height limit area.
[0066] The candidate height restriction region is determined based on multiple height restriction regions. As one possible implementation, multiple height restriction regions can be traversed, and the currently traversed height restriction region can be used as a candidate height restriction region. The bounding box of its bottom contour is compared with the bounding box of the planar contour of the component to be inspected. If a first intersection condition is met, the component to be inspected is determined as the target component, and the candidate height restriction region is determined as the target height restriction region. Generally, there may be at least one target height restriction region that meets the first intersection condition. This embodiment uses one as an example, but the subsequent processing applies to each target height restriction region.
[0067] As one possible implementation, the method for determining the bounding box of the bottom contour of the candidate height restriction area can be similar to the method for determining the bounding box of the component planar contour in S302. For example, the bounding box of the bottom contour of the height restriction area can be directly obtained as the bounding box using the geometric functions provided by the EDA tool; or, by traversing the coordinates of all vertices of the bottom contour of the height restriction area, calculating the minimum and maximum values of all vertices in the X-axis direction and the Y-axis direction respectively, and constructing a rectangle as the bounding box using these four values.
[0068] As one possible implementation, the first intersection condition includes: the projection range of the outer frame of the component to be inspected on the X-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the X-axis, and the projection range of the outer frame of the component to be inspected on the Y-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the Y-axis.
[0069] It should be understood that the projection range of the outer frame on the coordinate axis refers to the coordinate range of the outer frame in that coordinate axis direction. For example, for the outer frame of the component to be inspected, which includes a minimum X-coordinate x1, a minimum Y-coordinate y1, a maximum X-coordinate x2, and a maximum Y-coordinate y2, the projection range of the outer frame on the X-axis is [x1, x2], and the projection range on the Y-axis is [y1, y2]. For the outer frame of the bottom contour of the candidate height restriction area, which includes a minimum X-coordinate X1, a minimum Y-coordinate Y1, a maximum X-coordinate X2, and a maximum Y-coordinate Y2, the projection range of the outer frame on the X-axis is [X1, X2], and the projection range on the Y-axis is [Y1, Y2]. If [x1, x2] overlaps with [X1, X2], and [y1, y2] overlaps with [Y1, Y2], it indicates that the outer frame of the component to be inspected and the outer frame of the bottom contour of the candidate height restriction area satisfy the first intersection condition. Specifically, when x1≤X2 and X1≤x2, the projection intervals of the two bounding boxes on the X-axis overlap; when y1≤Y2 and Y1≤y2, the projection intervals of the two bounding boxes on the Y-axis overlap; if both conditions are met, the first intersection condition is established.
[0070] Since the above implementation method can determine whether two bounding boxes intersect by comparing four coordinate values without performing polygon Boolean operations, the judgment process only involves numerical comparison, and the amount of computation is minimal. Since this judgment can be performed quickly when traversing the height-limited area, it can quickly eliminate height-limited areas where the bounding boxes do not intersect, avoiding complex polygon intersection calculations for all height-limited areas one by one. Since the first intersection condition is only a coarse screening, its judgment result only needs to ensure that no potentially intersecting height-limited areas are missed. Therefore, the above coordinate interval overlap judgment can effectively reduce the computational burden of subsequent precise intersection judgment while ensuring the accuracy of screening, thereby improving the overall inspection efficiency.
[0071] Based on S303, the target component and the target height limit area are determined only when the outer frame of the component to be inspected and the outer frame of the candidate height limit area meet the first intersection condition. Therefore, it is possible to quickly filter out the height limit areas that may intersect, avoid performing complex polygon Boolean operations on all height limit areas, reduce the amount of calculation, and thus improve the inspection efficiency.
[0072] S304. When the Boolean intersection of the planar contour of the target component and the bottom contour of the target height restriction area satisfies the second intersection condition, determine whether the target component violates the height restriction of the target height restriction area based on the height attribute value of the target component and the height restriction value of the target height restriction area.
[0073] The second intersection condition includes: the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area is non-empty. It should be understood that a non-empty Boolean intersection means that the intersection result obtained after a Boolean AND operation between the two polygons is not an empty set; that is, they have a common part in space. This common part can be a point, a line segment, or a region. As long as a common part exists, it indicates that the target component actually intrudes into the target height-limited area in the board direction, rather than merely overlapping the outer frame. In other words, the first and second intersection conditions are different.
[0074] The planar profile of a target component refers to its actual projected shape on the printed circuit board surface. It is typically represented by a polygonal boundary (such as PLACE_BOUND) defined in the component package, reflecting the actual area occupied by the component on the board surface. The bottom profile of the target height-limited area refers to its projected shape on the printed circuit board surface. It is represented by a polygon and defines the planar range of the height-limited area.
[0075] As one possible implementation, determining the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-restricted area can be achieved by calling a geometric operation function. For example, in the Cadence Allegro platform, the axlPolyOperation function can be called, taking the polygon corresponding to the planar contour of the target component and the polygon corresponding to the bottom contour of the target height-restricted area as inputs, performing a Boolean AND operation to obtain the intersection result. If the intersection result is not empty, the second intersection condition is satisfied. The axlPolyOperation function is a function in CadenceAllegroSKILL used to perform Boolean logical operations (such as AND, OR, and ANDNOT) on two or more polygons, often used to accurately determine the intersection relationship of spatial objects or merge overlapping areas.
[0076] In one implementation, the Boolean intersection is non-empty. For example, if the planar outline of the target component is rectangle A and the bottom outline of the target height-limiting area is rectangle B, and the two partially overlap, then the intersection obtained by the Boolean "AND" operation is a smaller rectangular area, which is the part where the two actually overlap. At this time, it is determined that the second intersection condition is met.
[0077] In another implementation, the Boolean intersection is empty. For example, if the planar outline of the target component is rectangle A and the bottom outline of the target height restriction area is rectangle B, and the two are completely separated in space, or only the outer frames overlap but the actual polygons have no common parts, then the intersection obtained by the Boolean "AND" operation is an empty set. In this case, it is determined that the second intersection condition is not met, and the target component has not actually invaded the target height restriction area.
[0078] In this embodiment, since Boolean intersection operation is used to accurately determine the intersection between the planar contour of the target component and the bottom contour of the target height restriction area, it is possible to accurately identify whether the target component actually intrudes into the height restriction area. This effectively avoids false alarms caused by the overlap of the outer frame without actual intrusion, and improves the accuracy of the determination.
[0079] As one possible implementation, determining whether a target component violates height restrictions by exceeding the target height limit area is based on the height attribute value of the target component and the height limit value of the target height-limited area. This includes: obtaining the height attribute value of the target component, which is obtained by parsing the height attribute string carried on the component package and converting it to millimeters when the unit is mils; obtaining the height limit value of the target height-limited area, which is a uniform height threshold corresponding to the target height-limited area; comparing the height attribute value with the height limit value; if the height attribute value is greater than the height limit value, it is determined that the target component violates height restrictions by exceeding the target height limit area; if the height attribute value is less than or equal to the height limit value, it is determined that the target component does not violate height restrictions by exceeding the target height limit area.
[0080] This implementation method is applicable to scenarios where the height limit values are the same at all locations within the target height restriction area. In this case, there is no need to consider the height limit value changing with location. The violation determination can be completed by directly comparing the uniform height limit value of the target height restriction area with the height attribute value of the target component. The judgment logic is simple and the amount of calculation is small.
[0081] As another possible implementation, based on the height attribute value of the target component and the height limit value of the target height-limited area, determining whether the target component violates the height limit of the target height-limited area includes: determining the Boolean intersection region of the planar contour of the target component and the bottom contour of the target height-limited area; obtaining one or more height limit values corresponding to the Boolean intersection region within the target height-limited area; determining the minimum height limit value from the one or more height limit values; comparing the height attribute value of the target component with the minimum height limit value; if the height attribute value is greater than the minimum height limit value, determining that the target component violates the height limit of the target height-limited area; if the height attribute value is less than or equal to the minimum height limit value, determining that the target component does not violate the height limit of the target height-limited area.
[0082] This implementation method is applicable to scenarios where different locations within the target height restriction area have different height restriction values. By taking the minimum height restriction value corresponding to the Boolean intersection area as the comparison benchmark, it can ensure that as long as the target component is too high at any location within the actual intrusion area, it can be judged as a violation, thereby avoiding missed detection due to low local height restriction values. At the same time, it does not require comparison of coordinates at each location, simplifying the judgment process.
[0083] Based on S301 to S304, the acquired design data includes the planar contours and height attribute values of components, as well as the bottom contours and height limits of height-restricted areas, providing a complete data foundation for subsequent inspections. By using the bounding box of the planar contour of the component to be inspected as the first intersection condition for coarse screening, obviously non-intersecting height-restricted areas can be quickly eliminated, reducing computational load. After satisfying the first intersection condition, a second intersection condition is further refined using the Boolean intersection of the planar contour and the bottom contour of the height-restricted area, accurately confirming the actual intrusion relationship and avoiding false alarms caused by only bounding box overlap. After confirming the actual intrusion, the presence of height restriction violations is determined based on the height attribute values and height limits, accurately determining whether the target component exceeds the height limit. Therefore, this application balances inspection efficiency and judgment accuracy, solving the problems of low inspection efficiency or high false positive rates in related technologies.
[0084] For example, this application embodiment uses a two-level method of "pre-screening based on first intersection conditions + precise determination based on second intersection conditions" to determine whether a component falls within the height restriction area, balancing efficiency and accuracy. Here, SKILL refers to the scripting language provided by the CadenceAllegro platform for secondary development. The method for checking the height of printed circuit board components in this application embodiment can be implemented using a SKILL program, but is not limited to this. The specific implementation logic is as follows: (1) Pre-screening based on the first intersection condition.
[0085] One implementation involves first obtaining the bounding box (sym->bBox) of the planar outline of the component to be inspected and the bounding box (tp->bBox) of the bottom outline of the candidate height-limited region. The utility function UtilBBoxIntersect is then called to determine if the two bounding boxes intersect. If they do not intersect, it means the component cannot fall into the height-limited region, and it is skipped directly. This avoids performing polygon Boolean operations on all components individually, significantly improving inspection efficiency in large-scale designs.
[0086] (2) Precise determination of the second intersection condition.
[0087] One implementation involves further extracting the planar contours of components pre-screened based on the first intersection condition. The child objects (sym->children) of the component symbol are traversed to find the shape located on the PLACE_BOUND_TOP (or PLACE_BOUND_BOTTOM) layer, which is then converted into a component planar contour polygon (symPoly) using axlPolyFromDB. Subsequently, axlPolyOperation is called to perform a Boolean AND operation between the component planar contour polygon and the bottom contour polygon of the target height-limited region: if the result is not empty and the resulting polygon has an outer bounding box (->bBox exists), then the component planar contour and the bottom contour of the target height-limited region are considered to truly intersect, and the component falls within the target height-limited region; if the component lacks a PLACE_BOUND polygon (incomplete encapsulation library), the process degenerates to using the component's center point and the bottom contour of the target height-limited region for point inclusion determination, ensuring no omissions.
[0088] Based on the above two-level judgment method, compared with the method of judging only the center point in related technologies, it can accurately identify the situation where the edge part of the component intrudes into the height restriction area; compared with the method of judging the entire outer frame, it can eliminate false alarms when the outer frame of the component overlaps with the height restriction area but the actual planar outline does not intrude, thereby improving the judgment accuracy. Through two-level geometric intersection judgment, a spatial geometric correspondence between the planar outline of the component and the bottom outline of the height restriction area is established, so that the height inspection is extended from data comparison to spatial interference judgment.
[0089] For example, the key implementation code is as follows: Level 1: Pre-screening based on the first intersection condition foreach(tp topPolyList) when(sym->bBox&&tp->bBox&&UtilBBoxIntersect(sym->bBox tp->bBox) Level 2: Precise determination of the second intersection condition let((symChildren symPoly andResult pbLayer) symPoly = nil pbLayer = "PACKAGE GEOMETRY / PLACE_BOUND_TOP" foreach(ch sym->children when(equal(ch->layer pbLayer)&&symPoly == nil symPoly = axlPolyFromDB(ch))) if(symPoly then ;; Extract the planar outline polygon of the component, and perform a Boolean AND operation for precise determination. andResult = axlPolyOperation(symPoly list(tp) 'AND) when(andResult&&car(andResult)&&car(andResult)->bBox inTop = t) else Encapsulating polygons without planar contours degenerates into center point inclusion criteria. let((center) center = UtilBBoxCenter(sym->bBox) when(axlPolyOperation(list(list(center)) list(tp) 'AND) inTop = t) ))))) It should be noted that the function names, variable names, parameter forms, calling methods, and the Cadence Allegro platform and SKILL scripting language used in the above code examples are merely exemplary implementations of this application, and this application does not impose specific limitations on them. Those skilled in the art will understand that in specific implementations, other functions, interfaces, program modules, or programming languages with the same or similar functions can be used to replace the above examples to achieve the same technical effect. Similarly, the specific implementations of the first intersection condition, the second intersection condition, and the center point degradation determination are merely illustrative examples and do not constitute a limitation on the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application. The scope of protection of this application should be determined by the claims.
[0090] The following section describes a specific implementation method for determining a high degree of violation.
[0091] In some embodiments, please refer to Figure 4 , Figure 4 This is a flowchart illustrating a height violation determination method provided in an embodiment of this application. Based on the height attribute value of the target component and the height limit value of the target height-restricted area, the method determines whether the target component violates the height limit by exceeding the height restriction of the target height-restricted area, and further includes: S401. Determine the Boolean intersection region of the planar contour of the target component and the bottom contour of the target height-limited area.
[0092] As one possible implementation, after determining that the planar contour of the target component and the bottom contour of the target height restriction area satisfy the second intersection condition, the specific area of their Boolean intersection can be further obtained. For example, a polygonal object that returns the intersection result can be obtained through a preset geometric operation function, and the area covered by this polygonal object is the Boolean intersection area. This Boolean intersection area represents the actual extent of the board surface intruded by the target component into the target height restriction area. The preset geometric operation function can be a polygonal Boolean operation function provided in electronic design automation tools, such as the axlPolyOperation function in the Cadence Allegro platform; this application does not specifically limit it.
[0093] Based on S401, since the Boolean intersection region is determined, subsequent height comparisons can be performed only on this actual overlapping region, without having to compare the entire component or the entire height restriction region. This narrows the comparison range and improves the targeting and efficiency of height violation determination.
[0094] S402. For each location coordinate in the Boolean intersection region, determine the corresponding height limit value in the height limit mapping model.
[0095] The height restriction mapping model includes all position coordinates within the bottom contour of the target height restriction area and their corresponding height restriction values. It should be understood that the height restriction mapping model is used to characterize the maximum allowed height value at different locations within the target height restriction area. In one implementation, the height restriction mapping model can be a mapping table recording the height restriction value corresponding to each position coordinate; in another implementation, the model can be a functional relationship that calculates the corresponding height restriction value based on the position coordinates.
[0096] As one possible implementation, for each location coordinate in the Boolean intersection region, the corresponding height limit value can be obtained by querying the height limit mapping model. For example, the Boolean intersection region can be discretized into multiple location coordinate points, and for each location coordinate point, the corresponding height limit value can be found or calculated in the height limit mapping model.
[0097] As one possible implementation method, the determination of the height-restricted mapping model can be carried out in one of the following ways: Method 1: If the height limit value is the same at all points within the target height limit area, the height limit mapping model can be simplified to a unified height limit value, that is, the height limit value corresponding to all location coordinates is the same.
[0098] Method 2: If the height limit values are different at different locations within the target height limit area, the bottom contour of the target height limit area can be divided into multiple sub-regions based on the distribution of structural space margin. Each sub-region is assigned a corresponding height limit value, thereby establishing a mapping relationship between location coordinates and height limit values.
[0099] Method 3 involves setting and storing the corresponding height restriction value for each position coordinate within the bottom contour of the target height-restricted area, ensuring a one-to-one correspondence between each position coordinate and a height restriction value, thereby constructing a height restriction mapping model. This method is suitable for scenarios where the height restriction value changes continuously with position or where high accuracy is required for height violation determination. For example, the bottom contour of the target height-restricted area can be discretized into multiple position coordinates at a preset resolution, and a corresponding height restriction value can be assigned to each position coordinate according to the structural space margin, stored in the form of a mapping table or function. This application does not impose specific limitations on this method.
[0100] In this implementation, Method 2 assigns the same height limit value to each sub-region, and all coordinates within the sub-region share this height limit value; Method 3 assigns values independently to each coordinate, without dividing into sub-regions, and each coordinate has its own corresponding height limit value. Method 3 can be seen as a further refinement of Method 2 in terms of precision.
[0101] Based on S402, since the corresponding height limit value is determined for each location coordinate in the Boolean intersection region, it can adapt to complex scenarios where the height limit value changes with location within the height limit region, achieve refined height violation judgment, and avoid false alarms or missed alarms caused by using a uniform height limit value.
[0102] S403. If the height limit value corresponding to each position coordinate in the Boolean intersection region is greater than or equal to the height attribute value of the target component at the position coordinate, it is determined that the target component does not violate the height limit of the target height limit region.
[0103] It should be understood that, in the Z-axis direction perpendicular to the printed circuit board surface, the height attribute value of the target component represents the maximum height occupied by the component along the Z-axis direction, and the height limit value of the target height limit area represents the maximum height allowed in the area along the Z-axis direction. If the height limit value corresponding to each position coordinate in the Boolean intersection area is greater than or equal to the height attribute value of the target component, it means that the height of the target component in the Z-axis direction does not exceed the maximum height allowed in the height limit area.
[0104] Based on S403, since the absence of violation is only determined when the coordinates of each position within the Boolean intersection area meet the height limit requirements, the judgment conditions are strict, which can ensure the safety of the target component throughout the entire actual overlapping area and avoid the omission of local excessive height risks.
[0105] S404. Otherwise, it is determined that the target component violates the height restriction by exceeding the target height limit area.
[0106] As one possible implementation, if there is at least one location coordinate in the Boolean intersection region whose corresponding height limit value is less than the height attribute value of the target component at the location coordinate, then it is determined that the target component violates the height limit by exceeding the target height limit region.
[0107] It should be understood that, in the Z-axis direction perpendicular to the printed circuit board surface, the height attribute value of the target component represents the maximum height occupied by the component along the Z-axis direction, and the height limit value of the target height limit area represents the maximum height allowed in the area along the Z-axis direction. If there is at least one position coordinate within the Boolean intersection area whose height limit value is less than the height attribute value of the target component at that position coordinate, it means that the height of the target component in the Z-axis direction at that position exceeds the maximum height allowed in the height limit area, and there is a risk of structural interference.
[0108] Based on S404, since a violation is determined as long as there is a position coordinate within the Boolean intersection area whose height limit value is less than the height attribute value of the target component, it can sensitively capture local excessive height situations, ensuring that height interference risks are not overlooked, and further improving the reliability of the inspection.
[0109] Based on S401 to S404, since the Boolean intersection region is determined, subsequent height comparisons are only performed on the actual overlapping area, without comparing the entire component or the entire height-restricted area. This narrows the comparison range and improves the targeting and efficiency of height violation determination. Because a corresponding height limit value is determined for each coordinate in the Boolean intersection region within the height restriction mapping model, it can adapt to complex scenarios where height limit values change with location within the height-restricted area, achieving refined height violation determination and avoiding false alarms or missed alarms caused by using a uniform height limit value. Since a violation is only determined to exist when the height limit value corresponding to each coordinate in the Boolean intersection region is greater than or equal to the height attribute value of the target component, the determination conditions are strict and sensitive. This ensures the safety of the target component throughout the entire actual overlapping area and can capture local overheight situations, avoiding the omission of height interference risks and further improving the reliability of the inspection.
[0110] In other embodiments, the method for checking the height of printed circuit board components further includes: determining the center point coordinates of the target component; and determining that the target component violates the height limit of the target height limit area if the center point coordinates are located within the bottom contour of the target height limit area and the height limit value corresponding to the center point coordinates is less than the height attribute value of the target component.
[0111] As one possible implementation, the center point coordinates of the target component can be determined in one of the following ways: Method 1: Obtain the outer frame of the planar contour of the target component and use the center point coordinates of the outer frame as the center point coordinates of the target component; Method 2: Obtain the coordinates of multiple vertices of the planar contour of the target component, calculate the average value of the multiple vertices in the X-axis and Y-axis directions, and use the calculated coordinates as the center point coordinates of the target component; Method 3: Read the origin coordinates of the target component package and use the origin coordinates as the center point coordinates of the target component. This application does not specifically limit this method.
[0112] As one possible implementation, if the height limit value corresponding to the center point coordinates is less than the height attribute value of the target component, it can be determined as follows: Query the height limit value corresponding to the center point coordinates in the height limit mapping model, and compare the queried height limit value with the height attribute value of the target component. If the center point coordinates are located within the bottom contour of the target height limit area, and the queried height limit value is less than the height attribute value, then it is determined that the target component violates the height limit by exceeding the target height limit area. If the height limit value is uniform within the target height limit area, this uniform height limit value can be directly used as the height limit value corresponding to the center point coordinates.
[0113] It should be understood that when the planar outline of the target component cannot be obtained, or when high-precision Boolean intersection operations are not required, using the center point coordinates for judgment can quickly determine whether the target component may exceed the height limit area with a small amount of computation. When the center point coordinates are located within the bottom outline of the target height limit area, and the height limit value corresponding to the center point coordinates is less than the height attribute value of the target component, it indicates that the target component is already too tall at the center position. Based on this, a height limit violation is determined, ensuring no missed detections and avoiding the risk of skipping directly due to lack of planar outline data. Since determining the center point coordinates only requires simple geometric calculations, and the computational amount of point inclusion judgment and height limit value query is also small, this implementation method is simple to implement, fast in inspection, and suitable for scenarios with incomplete package libraries or high requirements for inspection efficiency, reducing the computational burden while ensuring that virtually no missed detections are made.
[0114] In some embodiments, considering that printed circuit boards typically have a top surface and a bottom surface, and that the components mounted on the top surface and the bottom surface have opposite orientations, different height constraint directions, and often different height limits, it is necessary to perform height checks on the top surface components and the bottom surface components separately, and present the check results separately.
[0115] The design data also includes the mounting surface attributes of each of the multiple components; the multiple components are divided into a top-mount component set and a bottom-mount component set based on the mounting surface attributes; the top-mount component set includes multiple components with the mounting surface attribute as top, and the bottom-mount component set includes multiple components with the mounting surface attribute as bottom.
[0116] It should be understood that the mounting surface attribute indicates whether a component is mounted on the top or bottom surface of the printed circuit board. Since top-mounted and bottom-mounted components correspond to different height restriction areas and values, mixing them for inspection may lead to incorrect height restriction area matching or incorrect height restriction value comparison. Therefore, components are divided into top-mounted component sets and bottom-mounted component sets based on the mounting surface attribute. This ensures that top-mounted components are compared only with the top height restriction area, and bottom-mounted components are compared only with the bottom height restriction area, thereby guaranteeing the accuracy of double-sided height inspection.
[0117] In one implementation, the mounting surface attribute can be determined by the mirror attribute of the component symbol. When the mirror attribute is false, it is determined to be a top-mounted component, and when the mirror attribute is true, it is determined to be a bottom-mounted component.
[0118] For example, to perform height checks on top and bottom components separately, a top and bottom height limit threshold is first set in a unified interface. Since the height attribute strings carried on component packages may not be consistent, to facilitate subsequent comparison with the height limit thresholds, the maximum height attribute string needs to be parsed to obtain the numerical value and unit identifier, and unit conversion is performed to achieve dimensional consistency (e.g., converting from mils to millimeters when the unit is mils, and directly using millimeters when the unit is millimeters). Simultaneously, to define height-limited areas in the printed circuit board design data, a top and bottom height limit layer is automatically detected and created. Based on this, the polygon shapes on the top and bottom height limit layers are obtained, and each shape is converted into a polygon geometry object, resulting in a top and bottom height limit polygon set. These sets are used to determine spatial intersection with the planar contours of the top and bottom components, respectively, to ascertain whether the component falls within the corresponding height-limited area.
[0119] For example, the top height limit threshold can be represented as _ChkHgt_TopLimitMM, and the bottom height limit threshold can be represented as _ChkHgt_BotLimitMM; the maximum height attribute string can be PACKAGE_HEIGHT_MAX; the top height limit layer can be BOARDGEOMETRY / RESTRICT_TOP, and the bottom height limit layer can be BOARDGEOMETRY / RESTRICT_BOTTOM. By obtaining the polygon shapes on the above layers and converting them into polygon geometry objects, the top height limit polygon set and the bottom height limit polygon set are obtained respectively. Then, spatial intersection is determined with the planar contours of the top and bottom components to determine whether the component falls into the corresponding height limit area.
[0120] As one possible implementation, if a target component violates height restrictions by exceeding the target height limit area and belongs to the top-mount component set, the height restriction violation information of the target component is added to the top-mount violation result set; if a target component violates height restrictions by exceeding the target height limit area and belongs to the bottom-mount component set, the height restriction violation information of the target component is added to the bottom-mount violation result set; the top-mount and bottom-mount violation result sets are sorted respectively, and the sorted top-mount and bottom-mount violation result sets are displayed in the top-view and bottom-view inspection views respectively.
[0121] The top-mount component set refers to the collection of components whose mounting surface attribute is top-mount; the bottom-mount component set refers to the collection of components whose mounting surface attribute is bottom-mount. The top-mount violation result set is used to include information on top-mount components that violate height limits exceeding the target height limit area; the bottom-mount violation result set is used to include information on bottom-mount components that violate height limits exceeding the target height limit area. The top-mount inspection view refers to the view area in the graphical interface used to display the top-mount violation result set; the bottom-mount inspection view refers to the view area in the graphical interface used to display the bottom-mount violation result set. The top-mount inspection view and the bottom-mount inspection view can be lists, windows, or panels, respectively, and this application does not specifically limit them.
[0122] It should be understood that since top-mounted components and bottom-mounted components correspond to different mounting surfaces, and the height restriction requirements for the top and bottom height restriction areas may differ, dividing components into top-mounted component sets and bottom-mounted component sets based on mounting surface attributes, and assigning violation information to the top-side violation result set and bottom-side violation result set respectively, can ensure that the inspection results of both sides do not interfere with each other. By sorting the two result sets separately and displaying them in the top-side inspection view and bottom-side inspection view respectively, designers can view and handle violations separately, avoiding the mixing of top-side and bottom-side results.
[0123] For example, components on the top and bottom surfaces of a printed circuit board face opposite directions. In this embodiment, the components can be distinguished by their mirrored attribute (isMirrored): a false mirrored attribute (isMirrored == nil) indicates a top-mounted component, while a true mirrored attribute (isMirrored == t) indicates a bottom-mounted component. In a box-selection inspection mode (_ChkHgtRunByBox), height checks are performed only on components matching the selected surface: bottom-mounted components with a true mirrored attribute are skipped during top-side inspection, and non-mirrorized top-side components are skipped during bottom-side inspection. In a shape-based inspection mode (_ChkHgtRunByShape), all components on the board are traversed at once. Top-side components are paired with top-side height-limited polygon sets, and bottom-side components are paired with bottom-side height-limited polygon sets based on their mirrored attributes. Double-sided inspections are completed in the same operation, and the results are stored in the top-side result set (topResults) and the bottom-side result set (botResults), respectively, and presented in two lists on the interface. This design solves the problem of double-sided inspection of cuts requiring two separate operations in related technologies.
[0124] As one possible implementation, the results can be sorted using the sorting function (_ChkHgtSortResults): Violating components with height data are arranged in descending order of height value, with the tallest components first, facilitating priority handling of the most severe interferences; components lacking height data are uniformly placed at the end of the list, distinguished by their nature. The top and bottom results are respectively filled into two independent lists (top_list, bot_list) above and below the form, allowing both sides of the results to be visible on the same screen without interference. The text format for each item in the list can be: Attribute No. Height mm (>Limited Height mm) (Center X, Center Y); for items lacking height data, Attribute No. N / A (Center X, Center Y) is displayed, providing clear and concise information.
[0125] It should be noted that the above-described example functions are merely illustrative and this application is not limited thereto. In specific implementations, other functions, interfaces, program modules, or programming languages with the same or similar functionalities can be used to replace the above-described example functions to achieve the same technical effect. The function names, parameter formats, calling methods, and platforms described above are only for illustrating one specific implementation of the technical solution of this application and should not be construed as limiting the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
[0126] In this implementation, since the top surface violation information and the bottom surface violation information are classified into different result sets, the double-sided inspection results do not interfere with each other; since the top surface violation result set and the bottom surface violation result set are sorted and displayed in the top surface inspection view and the bottom surface inspection view respectively, it is convenient for designers to view the results from different sides and prioritize the handling of serious violations; since the top surface and bottom surface inspections are completed in the same operation, the inspection efficiency is improved and the problem of missing one side that may occur when the operation is carried out in two separate operations is avoided.
[0127] In some embodiments, after determining that a target component violates a height restriction by exceeding the target height limit area, the violation type can be further distinguished based on the height attribute status of the target component. This includes: obtaining the height attribute status of the target component; when the height attribute status of the target component is that it has a valid height attribute value, determining the height restriction violation of the target component as a first type of violation; when the height attribute status of the target component is that it does not have a valid height attribute value, determining the height restriction violation of the target component as a second type of violation.
[0128] The height attribute status indicates whether the target component has a valid height attribute value. It should be understood that a valid height attribute value means the height attribute string on the target component's package can be successfully parsed, and the parsed value is valid; a invalid height attribute value means the target component's package does not carry a height attribute, or the height attribute string cannot be parsed, or the parsed value is invalid. The first type of violation corresponds to situations where the target component's height is confirmed to exceed the limit, which is a deterministic violation; the second type of violation corresponds to situations where the target component's height is insufficient to confirm whether it exceeds the limit, which is a violation requiring manual confirmation.
[0129] For example, the target component's package carries a maximum height attribute string, which is parsed to obtain a value and unit. If the value is greater than the height limit of the target height-limited area, the target component is determined to be a first type of violation. If the target component's package does not carry a maximum height attribute, or the string cannot be parsed to obtain a valid value, the target component is determined to be a second type of violation.
[0130] As one possible implementation, the first type of violation and the second type of violation correspond to different visual symbols, and the warning level of the visual symbol corresponding to the first type of violation is higher than that of the visual symbol corresponding to the second type of violation.
[0131] Visual identifiers refer to perceptible markings in a graphical interface used to distinguish different types of violations, including but not limited to at least one of color, line type, icon, marker symbol, and highlight style. Alertness level refers to the strength to which visual identifiers attract the designer's attention; the higher the alertness level, the more easily it attracts the designer's attention.
[0132] For example, the present application embodiment can adopt a classification coloring mechanism in the presentation of inspection results, and color the package shape of the non-compliant components one by one through the coloring function (_ChkHgtColorResults). The coloring can adopt the custom color mechanism of the design software (the custom color is enabled by the display control function axlDBDisplayControl, and the coloring is done by the custom color function axlCustomColorObject): For the first type of violation, that is, the target component with a valid height attribute value and the height value exceeds the limit value, it is highlighted with the first color (such as red) to indicate that the height has been confirmed to exceed the limit and needs to be dealt with first; for the second type of violation, that is, the target component without a valid height attribute value, it is highlighted with the second color (such as yellow) to indicate that the height data is missing and needs to be manually confirmed. Since red is more eye-catching than yellow, the visual warning level of the visual label corresponding to the first type of violation is higher than that of the second type of violation.
[0133] The color index can be scanned and matched in the current color palette using the color lookup function (_ChkHgtFindColorIndex): it iterates through all color entries with the target RGB values (red 255,0,0; yellow 255,255,0) and a tolerance of 30, automatically adapting to color palette differences in different design environments; if no matching color is found, it falls back to the default index (red=7, yellow=8), ensuring that the coloring function is available in any environment. After the check is complete, all custom colorings can be cleared using the clear color function (_ChkHgtClearColors), restoring the original design.
[0134] By classifying violations into Type I and Type II violations and assigning them different visual indicators of varying degrees of alert, designers can quickly distinguish between two different types of issues: "confirmed to be too high" and "missing height data pending confirmation." They can then prioritize addressing Type I violations, which have a higher level of alert, thereby improving the efficiency of investigation and modification.
[0135] For example, given a code example, which is not specifically limited in this application, it can be represented as follows: defun(_ChkHgtColorResults (results) let((comp sym) errset(axlDBDisplayControl('customColorEnabled t)) foreach(r results comp = axlDBFindByName('refdes (nth 0 r)) when(comp errset(axlDBRefreshId(comp)) sym = comp->symbol when(sym unless(member((nth 0 r) _ChkHgt_ColoredComps) _ChkHgt_ColoredComps = cons((nth 0 r) _ChkHgt_ColoredComps) ) if((nth 4 r) then Height data is available and exceeds the limit -> Red (Confirmed to exceed height) errset(axlCustomColorObject(list(sym) _ChkHgt_ColorRed)) else Missing height data -> Yellow (Pending manual confirmation) errset(axlCustomColorObject(list(sym) _ChkHgt_ColorYellow)) )))))) In the code above, the `_ChkHgtColorResults` function iterates through the violation result set `results`, searches for the symbol object of each violation component, and selects the color based on whether the result item has valid height data ((nth 4 r)): those with height data and exceeding the limit are colored red, and those lacking height data are colored yellow. Custom colors are enabled using `axlDBDisplayControl('customColorEnabled t')`, and the colors are applied to the component symbols using `axlCustomColorObject`, thus achieving categorized color highlighting. The variable `_ChkHgt_ColoredComps` is used to record the colored component reference designators to avoid duplicate coloring.
[0136] It should be noted that the above code is merely an exemplary implementation, and this application does not impose any specific limitations on it. Those skilled in the art can use other functions, interfaces, or programming languages with the same or similar functionality to achieve the same technical effect.
[0137] Based on the above embodiments, since violations are classified into first-type violations and second-type violations, and given different visual labels with different levels of warning, designers can quickly distinguish between two different types of problems: "confirmed to be too high" and "missing height data to be confirmed," and prioritize the first-type violations with higher warning levels, thereby improving the efficiency of investigation and modification.
[0138] In some embodiments, the method further includes: after displaying the violation results, providing linked navigation between the result list and the graphical view; the linked navigation includes at least one of the following: automatic positioning, selection positioning, navigation switching, view adaptation, and status feedback.
[0139] For example, the linked navigation between the result list and the graphical view can be achieved through the zoom positioning function (_ChkHgtZoomToItem), including: Automatic Location: After inspection, the graphical view is automatically zoomed to the area of the first non-compliant component in the sorted list, eliminating the need for manual searching. Selection Location: Responding to user selection of any item in the results list, the currently active results list is recorded, and the graphical view is precisely zoomed to the symbol object corresponding to the non-compliant component using the zoom function (axlZoomToDbid), highlighting it. Navigation Switching: Provides previous and next controls for cycling through the selected non-compliant items in the currently active results list; after reaching the last item, it loops back to the first item, enabling continuous browsing. View Adaptation: During location, layer visibility is automatically adjusted using the layer visibility setting function (_ChkHgtSetVisibility), displaying only layers relevant to the current inspection surface and disabling irrelevant layers to reduce visual interference. Status Feedback: The current inspection surface, current sequence number, and total number are updated in real-time in the interface title bar, and the tag number and coordinates of the non-compliant component are simultaneously output in the command line, forming multi-channel information feedback.
[0140] The aforementioned linkage navigation mechanism enables designers to quickly browse all violations, locate them instantly, and classify them for handling, significantly improving the efficiency of identifying and modifying highly disruptive issues.
[0141] In some embodiments, the method for checking the height of printed circuit board components provided in this application may include a first inspection mode and a second inspection mode, each adapted to different height restriction area definition methods. The first inspection mode determines the components to be inspected based on a box selection operation and is suitable for temporary, localized height checks. The second inspection mode determines the height restriction area based on a pre-drawn shape area and is suitable for scenarios where the structural height restriction area is clearly defined and batch checks are required; this is a preferred implementation of the present application.
[0142] The specific execution process for the two inspection modes will be explained next.
[0143] As one possible implementation method, please refer to Figure 5 , Figure 5 This is a flowchart illustrating a first inspection mode provided in an embodiment of this application. The execution flow of the first inspection mode (such as a selected area inspection) may include the following steps: Sa1, threshold reading.
[0144] When a user enters the top or bottom height limit value in the form and clicks the top or bottom check control, the callback function reads and verifies the validity of the threshold through a fault-tolerant reading function (such as errset). If the threshold is invalid, a message is displayed and the process is terminated.
[0145] Sa2, Region Selection.
[0146] The selection filter is set to "device only" by using a filter setting function (such as axlSetFindFilter). Then, the selection interaction function (such as axlSingleSelectBox) pops up a selection interaction, allowing the user to drag a box in the printed circuit board graphic area to select the components to be searched. After selection, the set of selected components is obtained by using a selection set retrieval function (such as axlGetSelSet), and the selection set is cleared.
[0147] Sa3, inspect each component individually.
[0148] Create a progress bar and iterate through the selected components. For each component, first check if its mounting surface attributes match the currently checked surface. If they do not match, skip it. If they match, check if the component has a planar outline on the corresponding surface. If it does not, skip it. For components with planar outlines, extract their height attribute values using a height extraction function (such as _ChkHgtGetMaxHeight).
[0149] Sa4, violation determination.
[0150] When a component lacks a height attribute value or its height attribute value exceeds the height limit, the component is recorded as a violation and stored in the results list. The results list includes at least one of the following: tag number, height value, center coordinates, face it is located on, and whether it has height data.
[0151] Sa5, Result Processing.
[0152] After the inspection is completed, the progress bar is destroyed, the results are sorted in descending order of height, the missing height data is placed at the end, the corresponding face is filled into the list, highlighted, and automatically scaled and positioned to the first non-compliant component.
[0153] Based on Sa1-Sa5, since the components to be inspected are temporarily determined through a selection operation, there is no need to pre-draw height-limited areas, thus enabling rapid height verification of local areas, which is suitable for temporary inspection scenarios. Because the mounting surface attributes, planar contour existence, and height attribute values of each selected component are checked one by one, non-compliant components with missing height data or exceeding height limits can be accurately screened out, avoiding missed inspections. Because the non-compliant results are sorted in descending order of height and those with missing height data are sorted separately, it is convenient to prioritize the handling of serious non-compliant items. Because the results are highlighted with color and automatically scaled to the first item, it is convenient for designers to quickly locate and verify.
[0154] As one possible implementation method, please refer to Figure 6 , Figure 6 This is a flowchart illustrating a second inspection mode provided in an embodiment of this application. The execution flow of the second inspection mode (such as inspection by pre-drawn shape area) may include the following steps: Sb1, double-sided threshold verification.
[0155] Verify the top and bottom height limits; the process can proceed only if at least one is valid, otherwise prompt for abort.
[0156] Sb2, height-restricted area data collection.
[0157] Based on the effective threshold surface, obtain all polygon shapes from the top height limit layer and the bottom height limit layer respectively, and convert them into top height limit polygon sets and bottom height limit polygon sets using a polygon conversion function (such as axlPolyFromDB); if neither layer has any shapes, indicate an infinite height area and abort.
[0158] Sb3, full board traversal.
[0159] The system retrieves all components from the design database, creates a progress bar, and processes each component one by one. For each component, it determines the surface it belongs to based on the mounting surface attributes and checks either the top or bottom surface branch.
[0160] Sb4, Intersection determination of two levels.
[0161] Taking the top surface as an example, for each top surface component, the set of top surface height-limited polygons is traversed. First, the first intersection condition is pre-screened using the bounding box intersection function (such as UtilBBoxIntersect). For those that pass the pre-screening, the planar outline polygons of the components are extracted, and a Boolean "AND" operation is performed using the polygon Boolean operation function (such as axlPolyOperation). The second intersection condition is used to accurately determine whether it falls into the target height-limited area.
[0162] Sb5, violation judgment and separate recording on both sides.
[0163] Components that fall into the target height restriction area and lack height attribute values or have height attribute values exceeding the limit are recorded in the top surface violation result set or the bottom surface violation result set, respectively; the top surface and bottom surface checks are completed in the same traversal, without the need for two separate operations.
[0164] Sb6, Results Presentation.
[0165] The results on both sides are sorted, filled into their respective lists, and highlighted with color. The results on the top side are displayed first and positioned as the first item.
[0166] Based on Sb1-Sb6, since the height restriction areas are pre-drawn on the top and bottom height restriction layers and automatically collected by the system, no manual input of each area is required, making it suitable for batch verification scenarios where the structural height restriction areas are clearly defined. Because all components on the board are traversed and the inspection branches are accessed based on the mounting surface attributes (top or bottom), it can comprehensively cover components on both sides, avoiding omissions. The two-level approach, combining pre-screening under the first intersection condition with precise judgment under the second intersection condition, balances inspection efficiency and judgment accuracy, quickly eliminating obviously non-intersecting components while accurately identifying components that actually intrude into the height restriction area. Since the top and bottom inspections are completed and recorded separately in the same traversal, the efficiency of double-sided inspection is improved, avoiding the possibility of missing one side when operating in two separate steps. Because the results for both sides are sorted, displayed, colored, and positioned separately, it is convenient for designers to view the results from different sides and prioritize the handling of serious violations.
[0167] It should be noted that both of the above inspection modes use the aforementioned first and second intersection conditions for spatial intersection determination; the only difference lies in the method of determining the component to be inspected and the method of obtaining the height-limited area. The function names, control names, and platforms mentioned above are merely illustrative examples, and this application does not impose any specific limitations on them.
[0168] In some embodiments, the height-restricted area is drawn as a polygon shape on the top and bottom height-restricted layers, in the same coordinate system and view as the components. Designers can intuitively view the spatial relationship between the height-restricted area boundary and the components. Compared with the existing technology that defines the height-restricted area using text rules or coordinate lists, this solution only requires adjusting the graphic when modifying the height-restricted area, without needing to re-edit the rule parameters, making maintenance convenient and less prone to errors. The same layer supports drawing multiple shapes, which can flexibly adapt to irregular structural spaces such as above the battery compartment, below the shielding cover, and connector avoidance areas, improving the flexibility and maintainability of the height-restricted area definition.
[0169] In some embodiments, this application executes only a read-only process from beginning to end, including reading height data, determining spatial intersection, and visualizing the data. It does not create any new attributes, modify any component height values, write back to the package library, persistently store intermediate results, or generate independent report files. The component height data remains completely unchanged before and after the inspection, and the design files are unaffected by the inspection operation. This ensures the integrity and traceability of the design data, avoids the risk of data contamination introduced by the inspection operation, and allows the inspection process to be executed repeatedly without altering the original design.
[0170] The method for checking the height of printed circuit board components according to the embodiments of this application has been described above. The apparatus for performing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced in each other. The related apparatus provided in the embodiments of this application can perform the steps in the above-described method for checking the height of printed circuit board components. The related apparatus can be referred to the following description: Figure 7 This is a schematic diagram of a device for checking the height of printed circuit board components, provided in an embodiment of this application. The device 700 for checking the height of printed circuit board components may include: a data acquisition module 701, a component determination module 702, an intersection judgment module 703, and a violation determination module 704.
[0171] The data acquisition module 701 is used to acquire the design data of the printed circuit board, which includes the planar contours and height attribute values of multiple components, as well as the bottom contours and height limits of multiple height-limited areas. The component determination module 702 is used to determine the outer frame of the component to be inspected and its planar contour. The component to be inspected is determined based on multiple components, and the edge complexity of the outer frame is less than the edge complexity of the planar contour. The intersection judgment module 703 is used to determine the component to be inspected as the target component and the candidate height-limited area as the target height-limited area when the intersection result of the outer frame of the component to be inspected and the outer frame of the bottom contour of the candidate height-limited area meets the first intersection condition. The candidate height-limited area is determined based on multiple height-limited areas. The violation determination module 704 is used to determine whether the target component violates the height limit of the target height-limited area when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area meets the second intersection condition, based on the height attribute value of the target component and the height limit value of the target height-limited area.
[0172] In one possible implementation, the violation determination module 704 is specifically used to determine whether the target component violates the height restriction of the target height restriction area based on the height attribute value of the target component and the height restriction value of the target height restriction area. This includes: determining the Boolean intersection region of the planar contour of the target component and the bottom contour of the target height restriction area; determining the corresponding height restriction value in the height restriction mapping model for each position coordinate in the Boolean intersection region; the height restriction mapping model includes all position coordinates and their corresponding height restriction values within the bottom contour of the target height restriction area; if the height restriction value corresponding to each position coordinate in the Boolean intersection region is greater than or equal to the height attribute value of the target component at the position coordinate, it is determined that the target component does not violate the height restriction of the target height restriction area; otherwise, it is determined that the target component violates the height restriction of the target height restriction area.
[0173] In one possible implementation, the violation determination module 704 is also used to determine the center point coordinates of the target component; if the center point coordinates are located within the bottom contour of the target height restriction area and the height restriction value corresponding to the center point coordinates is less than the height attribute value of the target component, it is determined that the target component has a height restriction violation that exceeds the target height restriction area.
[0174] In one possible implementation, the design data also includes the mounting surface attributes of each of the multiple components; the multiple components are divided into a top-mount component set and a bottom-mount component set based on the mounting surface attributes; the top-mount component set includes multiple components with the mounting surface attribute as top, and the bottom-mount component set includes multiple components with the mounting surface attribute as bottom.
[0175] The printed circuit board component height inspection device 700 also includes a violation display module 705, which is used to: add the height restriction violation information of the target component to the top violation result set when the target component exceeds the target height limit area and the target component belongs to the top surface mount component set; add the height restriction violation information of the target component to the bottom surface violation result set when the target component exceeds the target height limit area and the target component belongs to the bottom surface mount component set; sort the top surface violation result set and the bottom surface violation result set respectively, and display the sorted top surface violation result set and bottom surface violation result set in the top surface inspection view and the bottom surface inspection view respectively.
[0176] In one possible implementation, after determining that the target component violates the height restriction by exceeding the target height limit area, the violation display module 705 is further configured to: obtain the height attribute status of the target component; the height attribute status indicates whether the target component has a valid height attribute value; when the height attribute status of the target component is that it has a valid height attribute value, the height restriction violation of the target component is determined as a first type of violation; when the height attribute status of the target component is that it does not have a valid height attribute value, the height restriction violation of the target component is determined as a second type of violation; wherein, the first type of violation and the second type of violation correspond to different visual identifiers, and the warning level of the visual identifier corresponding to the first type of violation is higher than that of the visual identifier corresponding to the second type of violation.
[0177] In one possible implementation, the first intersection condition includes: the projection range of the outer frame of the component to be inspected on the X-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the X-axis, and the projection range of the outer frame of the component to be inspected on the Y-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height limit region on the Y-axis.
[0178] In one possible implementation, the second intersection condition includes: the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limited area is non-empty.
[0179] This application also provides an electronic device, as described in the embodiments. Figure 8 The electronic device 800 may include a memory 810, a processor 820, and a communication interface 830. The memory 810, processor 820, and communication interface 830 are connected via internal connection paths. The memory 810 stores instructions, and the processor 820 executes the instructions stored in the memory 810 to control the communication interface 830 to acquire information, thereby enabling the electronic device 800 to implement the aforementioned method. Optionally, the memory 810 may be coupled to the processor 820 via an interface, or it may be integrated with the processor 820.
[0180] It should be noted that the communication interface 830 described above uses a transceiver device, such as, but not limited to, a transceiver. The communication interface 830 may also include an input / output interface.
[0181] The processor 820 stores one or more computer programs, which include instructions. When the instructions are executed by the processor 820, the electronic device 800 performs the methods described in the above embodiments.
[0182] In implementation, each step of the above method can be completed by the integrated logic circuits in the hardware of the processor 820 or by instructions in software form. The method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 810, and the processor 820 reads the information in memory 810 and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are not provided here.
[0183] As one possible implementation, electronic device 800 can be a physical device, such as including one or more of the following modules: central processing unit, microprocessor, application-specific integrated circuit, field-programmable gate array, complex programmable logic device (CPLD), coprocessor (assisting the central processing unit in completing corresponding processing and applications), microcontroller unit (MCU), domain controller (DC), vehicle domain controller unit (VDC), electronic control unit (ECU), cockpit domain controller (CDC), vehicle integrated unit (VIU), vehicle control unit (VCU), motor control unit, etc. Furthermore, electronic device 800 includes multiple processors integrated in the form of a system-on-chip (SoC), commonly referred to by those skilled in the art as an SoC. This SoC may include multiple processors, and when the SoC includes multiple processors, the types of these processors can be different.
[0184] Optionally, Figure 8 The memory 810 in the memory can store printed circuit board design data, height limit mapping models, and computer programs or instructions, etc. Figure 8 The processor 820 in the above embodiment can implement the steps in the printed circuit board component height inspection method.
[0185] This application also provides a computer-readable storage medium storing program code that, when run on a computer, causes the computer to perform any of the methods described in the above embodiments.
[0186] This application also provides a computer program product, which includes a computer program that, when run, causes the computer to perform any of the methods described in the above embodiments.
[0187] This application also provides a chip, including: a circuit for performing any of the methods in the above embodiments.
[0188] This application also provides a device, including... Figure 7 The printed circuit board component height inspection device 700 shown is... Figure 8 The electronic device 800 shown can perform any of the methods in the above embodiments.
[0189] This application also provides a vehicle, including... Figure 7The printed circuit board component height inspection device 700 shown is... Figure 8 The electronic device shown is 800.
[0190] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0191] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0192] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0193] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0194] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0195] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0196] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0197] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the description of embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0198] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
Claims
1. A method for inspecting the height of components on a printed circuit board, characterized in that, include: Obtain the design data of the printed circuit board, which includes the planar contours and height attribute values of multiple components, as well as the bottom contours and height limit values of multiple height-limited areas; The component to be inspected and its planar outline bounding box are determined; the component to be inspected is determined based on the plurality of components, and the edge complexity of the bounding box of the planar outline is less than the edge complexity of the planar outline; When the intersection result of the outer frame of the planar contour of the component to be inspected and the outer frame of the bottom contour of the candidate height restriction area satisfies the first intersection condition, the component to be inspected is determined to be the target component and the candidate height restriction area is determined to be the target height restriction area; the candidate height restriction area is determined based on the plurality of height restriction areas; When the Boolean intersection of the planar contour of the target component and the bottom contour of the target height restriction area satisfies the second intersection condition, based on the height attribute value of the target component and the height restriction value of the target height restriction area, it is determined whether the target component violates the height restriction of the target height restriction area.
2. The method according to claim 1, characterized in that, The step of determining whether the target component violates the height limit of the target height limit area by comparing its height attribute value with the height limit value of the target height limit area includes: Determine the Boolean intersection region of the planar contour of the target component and the bottom contour of the target height-limiting area; For each position coordinate in the Boolean intersection region, the corresponding height limit value is determined in the height limit mapping model; the height limit mapping model includes all position coordinates within the bottom contour of the target height limit region and their corresponding height limit values; If the height limit value corresponding to each position coordinate in the Boolean intersection region is greater than or equal to the height attribute value of the target component at the position coordinate, it is determined that the target component does not violate the height limit of the target height limit region. Otherwise, it is determined that the target component violates the height restriction by exceeding the target height limit area.
3. The method according to claim 2, characterized in that, The method further includes: Determine the coordinates of the center point of the target component; If the center point coordinates are located within the bottom contour of the target height restriction area, and the height restriction value corresponding to the center point coordinates is less than the height attribute value of the target component, it is determined that the target component violates the height restriction of the target height restriction area.
4. The method according to claim 1, characterized in that, The design data also includes the mounting surface attributes of each of the multiple components; the multiple components are divided into a top-mount component set and a bottom-mount component set based on the mounting surface attributes; the top-mount component set includes multiple components with the mounting surface attribute as top, and the bottom-mount component set includes multiple components with the mounting surface attribute as bottom. The method further includes: If the target component violates the height limit by exceeding the target height limit area, and the target component belongs to the top-mount component set, the height limit violation information of the target component is added to the top-mount violation result set. If the target component violates the height limit by exceeding the target height limit area, and the target component belongs to the bottom-mount component set, the height limit violation information of the target component is added to the bottom violation result set. The top surface violation result set and the bottom surface violation result set are sorted respectively, and the sorted top surface violation result set and the bottom surface violation result set are displayed in the top surface inspection view and the bottom surface inspection view respectively.
5. The method according to claim 2, characterized in that, After determining that the target component violates the height restriction by exceeding the target height limit area, the method further includes: Obtain the height attribute status of the target component; the height attribute status is used to indicate whether the target component has a valid height attribute value. When the height attribute status of the target component is that it has a valid height attribute value, the height restriction violation of the target component is determined as a first type of violation; When the height attribute status of the target component is that it does not have a valid height attribute value, the height restriction violation of the target component is determined as a second type of violation; The first type of violation and the second type of violation correspond to different visual symbols, and the warning level of the visual symbol corresponding to the first type of violation is higher than that of the visual symbol corresponding to the second type of violation.
6. The method according to claim 1, characterized in that, The first intersection condition includes: The projection range of the outer frame of the component to be inspected on the X-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height restriction area on the X-axis, and the projection range of the outer frame of the component to be inspected on the Y-axis overlaps with the projection range of the outer frame of the bottom contour of the candidate height restriction area on the Y-axis.
7. The method according to claim 1, characterized in that, The second intersection condition includes: the Boolean intersection of the planar contour of the target component and the bottom contour of the target height-limiting area is non-empty.
8. A device for checking the height of components on a printed circuit board, characterized in that, include: The data acquisition module is used to acquire the design data of the printed circuit board. The design data includes the planar contours of multiple components and their height attribute values, as well as the bottom contours of multiple height-limited areas and their height limit values. The component determination module is used to determine the outer frame of the component to be inspected and its planar contour; the component to be inspected is determined based on the plurality of components, and the edge complexity of the outer frame is less than the edge complexity of the planar contour. The intersection determination module is used to determine that the component to be inspected is a target component and the candidate height restriction area is a target height restriction area when the intersection result of the outer frame of the component to be inspected and the outer frame of the bottom contour of the candidate height restriction area meets the first intersection condition; the candidate height restriction area is determined based on the plurality of height restriction areas. The violation determination module is used to determine whether the target component violates the height limit of the target height limit area by using the height attribute value of the target component and the height limit value of the target height limit area when the Boolean intersection of the planar contour of the target component and the bottom contour of the target height limit area satisfies the second intersection condition.
9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program or instructions that, when executed by the processor, implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-7.
