KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fab_drill.cpp
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
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU 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
20
#include "
fab_drill.h
"
21
22
#include <algorithm>
23
#include <
lseq.h
>
24
25
26
PCB_LAYER_ID
FabBackdrillMustNotCut
(
const
LSEQ
& aCopperStack,
PCB_LAYER_ID
aStart,
PCB_LAYER_ID
aMustCut )
27
{
28
auto
it = std::find( aCopperStack.begin(), aCopperStack.end(), aMustCut );
29
30
if
( it == aCopperStack.end() )
31
return
UNDEFINED_LAYER
;
32
33
if
( aStart ==
F_Cu
)
34
{
35
++it;
36
37
return
it == aCopperStack.end() ?
UNDEFINED_LAYER
: *it;
38
}
39
40
if
( aStart ==
B_Cu
)
41
{
42
return
it == aCopperStack.begin() ?
UNDEFINED_LAYER
: *( --it );
43
}
44
45
return
UNDEFINED_LAYER
;
46
}
LSEQ
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition
lseq.h:47
FabBackdrillMustNotCut
PCB_LAYER_ID FabBackdrillMustNotCut(const LSEQ &aCopperStack, PCB_LAYER_ID aStart, PCB_LAYER_ID aMustCut)
aMustCut is DRILL_PROPS.end; returns the next enabled copper past it away from aStart,...
Definition
fab_drill.cpp:26
fab_drill.h
PCB_LAYER_ID
PCB_LAYER_ID
A quick note on layer IDs:
Definition
layer_ids.h:56
B_Cu
@ B_Cu
Definition
layer_ids.h:61
UNDEFINED_LAYER
@ UNDEFINED_LAYER
Definition
layer_ids.h:57
F_Cu
@ F_Cu
Definition
layer_ids.h:60
lseq.h
src
pcbnew
exporters
fab_model
fab_drill.cpp
Generated on Wed Oct 7 2026 00:06:02 for KiCad PCB EDA Suite by
1.13.2