KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_utils.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
25
26
#pragma once
27
28
#include <functional>
29
30
#include <wx/string.h>
31
32
#include <
geometry/eda_angle.h
>
33
#include <
math/vector2d.h
>
34
#include <
pad_utils.h
>
35
36
class
BOARD_ITEM
;
37
class
FOOTPRINT
;
38
class
PAD
;
39
class
UNITS_PROVIDER
;
40
41
58
bool
ComputeFootprintShift
(
const
FOOTPRINT
& aExisting,
const
FOOTPRINT
& aNew,
VECTOR2I
& aShift,
59
EDA_ANGLE
& aAngleShift );
60
61
62
namespace
FOOTPRINT_UTILS
63
{
64
65
using
PAD_CHECK_HANDLER
= std::function<void(
const
PAD
&,
const
PAD_UTILS::PAD_CHECK_RESULT
& )>;
66
67
74
void
CheckFootprintAttributes
(
const
FOOTPRINT
& aFootprint,
75
const
std::function<
void
(
const
wxString& )>& aErrorHandler );
76
77
86
void
CheckPads
(
const
FOOTPRINT
& aFootprint,
const
UNITS_PROVIDER
& aUnitsProvider,
87
const
PAD_CHECK_HANDLER
& aErrorHandler );
88
89
93
void
CheckShortingPads
(
const
FOOTPRINT
& aFootprint,
94
const
std::function<
void
(
const
PAD
*,
const
PAD
*,
int
aErrorCode,
95
const
VECTOR2I
& )>& aErrorHandler );
96
97
102
void
CheckNetTies
(
const
FOOTPRINT
& aFootprint,
103
const
std::function<
void
(
const
BOARD_ITEM
*,
const
BOARD_ITEM
*,
104
const
BOARD_ITEM
*,
const
VECTOR2I
& )>& aErrorHandler );
105
106
111
void
CheckNetTiePadGroups
(
const
FOOTPRINT
& aFootprint,
112
const
std::function<
void
(
const
wxString& )>& aErrorHandler );
113
114
118
void
CheckClippedSilk
(
const
FOOTPRINT
& aFootprint,
119
const
std::function<
void
(
BOARD_ITEM
*,
BOARD_ITEM
*,
120
const
VECTOR2I
& )>& aErrorHandler );
121
122
}
// namespace FOOTPRINT_UTILS
BOARD_ITEM
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition
board_item.h:85
EDA_ANGLE
Definition
eda_angle.h:36
FOOTPRINT
Definition
footprint.h:265
PAD
Definition
pad.h:61
UNITS_PROVIDER
Definition
units_provider.h:31
eda_angle.h
ComputeFootprintShift
bool ComputeFootprintShift(const FOOTPRINT &aExisting, const FOOTPRINT &aNew, VECTOR2I &aShift, EDA_ANGLE &aAngleShift)
Compute position and angle shift between two footprints.
Definition
footprint_utils.cpp:43
FOOTPRINT_UTILS
Definition
footprint_utils.h:63
FOOTPRINT_UTILS::CheckClippedSilk
void CheckClippedSilk(const FOOTPRINT &aFootprint, const std::function< void(BOARD_ITEM *, BOARD_ITEM *, const VECTOR2I &)> &aErrorHandler)
Check for silkscreen graphics clipped by solder mask apertures.
Definition
footprint_utils.cpp:390
FOOTPRINT_UTILS::CheckFootprintAttributes
void CheckFootprintAttributes(const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler)
Check that the footprint's SMD/through-hole attribute matches its pads.
Definition
footprint_utils.cpp:137
FOOTPRINT_UTILS::CheckNetTies
void 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.
Definition
footprint_utils.cpp:252
FOOTPRINT_UTILS::CheckShortingPads
void 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.
Definition
footprint_utils.cpp:180
FOOTPRINT_UTILS::CheckPads
void CheckPads(const FOOTPRINT &aFootprint, const UNITS_PROVIDER &aUnitsProvider, const PAD_CHECK_HANDLER &aErrorHandler)
Run non-board-specific DRC checks on footprint's pads.
Definition
footprint_utils.cpp:163
FOOTPRINT_UTILS::PAD_CHECK_HANDLER
std::function< void(const PAD &, const PAD_UTILS::PAD_CHECK_RESULT &)> PAD_CHECK_HANDLER
Definition
footprint_utils.h:65
FOOTPRINT_UTILS::CheckNetTiePadGroups
void CheckNetTiePadGroups(const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition
footprint_utils.cpp:366
pad_utils.h
PAD_UTILS::PAD_CHECK_RESULT
A single finding from CheckPad().
Definition
pad_utils.h:107
vector2d.h
VECTOR2I
VECTOR2< int32_t > VECTOR2I
Definition
vector2d.h:708
src
pcbnew
footprint_utils.h
Generated on Tue Oct 27 2026 00:06:32 for KiCad PCB EDA Suite by
1.13.2