|
KiCad PCB EDA Suite
|
Collection of reusable/testable functions for footprint manipulation and validation. More...
#include <functional>#include <wx/string.h>#include <geometry/eda_angle.h>#include <math/vector2d.h>#include <pad_utils.h>Go to the source code of this file.
Namespaces | |
| namespace | FOOTPRINT_UTILS |
Typedefs | |
| using | FOOTPRINT_UTILS::PAD_CHECK_HANDLER = std::function<void( const PAD&, const PAD_UTILS::PAD_CHECK_RESULT& )> |
Functions | |
| bool | ComputeFootprintShift (const FOOTPRINT &aExisting, const FOOTPRINT &aNew, VECTOR2I &aShift, EDA_ANGLE &aAngleShift) |
| Compute position and angle shift between two footprints. | |
| void | FOOTPRINT_UTILS::CheckFootprintAttributes (const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler) |
| Check that the footprint's SMD/through-hole attribute matches its pads. | |
| void | FOOTPRINT_UTILS::CheckPads (const FOOTPRINT &aFootprint, const UNITS_PROVIDER &aUnitsProvider, const PAD_CHECK_HANDLER &aErrorHandler) |
| Run non-board-specific DRC checks on footprint's pads. | |
| void | FOOTPRINT_UTILS::CheckShortingPads (const FOOTPRINT &aFootprint, const std::function< void(const PAD *, const PAD *, int aErrorCode, const VECTOR2I &)> &aErrorHandler) |
| Check for overlapping, different-numbered, non-net-tie pads. | |
| void | FOOTPRINT_UTILS::CheckNetTies (const FOOTPRINT &aFootprint, const std::function< void(const BOARD_ITEM *, const BOARD_ITEM *, const BOARD_ITEM *, const VECTOR2I &)> &aErrorHandler) |
| Check for un-allowed shorting of pads in net-tie footprints. | |
| void | FOOTPRINT_UTILS::CheckNetTiePadGroups (const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler) |
| Sanity check net-tie pad groups. | |
| void | FOOTPRINT_UTILS::CheckClippedSilk (const FOOTPRINT &aFootprint, const std::function< void(BOARD_ITEM *, BOARD_ITEM *, const VECTOR2I &)> &aErrorHandler) |
| Check for silkscreen graphics clipped by solder mask apertures. | |
Collection of reusable/testable functions for footprint manipulation and validation.
Definition in file footprint_utils.h.
| bool ComputeFootprintShift | ( | const FOOTPRINT & | aExisting, |
| const FOOTPRINT & | aNew, | ||
| VECTOR2I & | aShift, | ||
| EDA_ANGLE & | aAngleShift ) |
Compute position and angle shift between two footprints.
This will only happen when the new footprint has a different origin or has been rotated compared to the existing footprint. Most of the time, this returns a null shift.
The shift is computed based on pad positions and assumes that there are at least two non-coincident pads with unique numbers that are the same in both footprints.
Pad positions are compared on the side of the existing footprint. A footprint on the back of the board stores its pads mirrored in its library frame, so if the new footprint is on the other side (and will be flipped onto the existing footprint's side when it is exchanged in), its pad positions are mirrored to match before the shift is computed.
Definition at line 43 of file footprint_utils.cpp.
References ANGLE_0, FOOTPRINT::GetOrientation(), GetRotated(), ORTHO_ITEM_REALIGNER::GetTransform(), FOOTPRINT::IsFlipped(), MIRROR(), pad, and result.
Referenced by BOARD::ExchangeFootprint(), and FP_REALIGNMENT_TEST_FIXTURE::ExecuteTestCase().