76 if( aDrill.
size.
y > 0 )
85 std::vector<DRILL_OPERATION>& aOut )
91 auto boardSide = [&](
PCB_LAYER_ID aLayer,
bool aFront,
bool aBack )
93 return aLayer ==
F_Cu ? aFront : aLayer ==
B_Cu ? aBack :
false;
114 auto setProtection = [&](
DRILL_OPERATION& aOp, std::optional<bool> aFilled, std::optional<bool> aCapped )
130 return std::optional<int>();
142 std::optional<DRILL_OPERATION> op = backdrillOperation( aDrill, aKind, span, aVia );
150 op->m_StubLength = stubLength( aDrill.
start, aDrill.
end );
152 op->m_Filled = aDrill.
is_filled.value_or(
false );
153 op->m_Capped = aDrill.
is_capped.value_or(
false );
154 aOut.push_back( std::move( *op ) );
169 aVia->
LayerPair( &topLayer, &bottomLayer );
199 aOut.push_back( op );
203void enumeratePad(
PAD* aPad,
const DRILL_QUERY& aQuery, std::vector<DRILL_OPERATION>& aOut )
212 std::optional<DRILL_OPERATION> op = backdrillOperation( aDrill, aKind, aQuery.
m_Span, aPad );
220 aOut.push_back( std::move( *op ) );
278 aOut.push_back( op );
293 std::vector<DRILL_OPERATION> operations;
304 enumerateVia(
static_cast<PCB_VIA*
>( track ), aBoard, aQuery, operations );
313 for(
PAD*
pad : footprint->Pads() )
314 enumeratePad(
pad, aQuery, operations );
324 std::set<DRILL_SPAN> unique;
328 if( isBackdrillSet( aDrill ) )
330 unique.emplace( aDrill.
start, aDrill.
end,
true,
false );
342 via->LayerPair( &
top, &bottom );
345 unique.emplace(
top, bottom,
false,
false );
347 addBackdrill(
via->Padstack().SecondaryDrill() );
348 addBackdrill(
via->Padstack().TertiaryDrill() );
355 for(
PAD*
pad : footprint->Pads() )
357 addBackdrill(
pad->Padstack().SecondaryDrill() );
358 addBackdrill(
pad->Padstack().TertiaryDrill() );
363 std::vector<DRILL_SPAN> spans;
364 spans.emplace_back(
F_Cu,
B_Cu,
false,
false );
369 spans.push_back( span );
Container for design settings for a BOARD object.
BOARD_STACKUP & GetStackupDescriptor()
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Manage layers needed to make a physical board.
int GetLayerDistance(PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer) const
Calculate the distance (height) between the two given copper layers.
Information pertinent to a Pcbnew printed circuit board.
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
std::optional< bool > IsFilled() const
std::optional< bool > IsTented(PCB_LAYER_ID aSide) const
Checks if this padstack is tented (covered in soldermask) on the given side.
POST_MACHINING_PROPS & FrontPostMachining()
std::optional< bool > IsPlugged(PCB_LAYER_ID aSide) const
DRILL_PROPS & TertiaryDrill()
std::optional< bool > IsCapped() const
std::optional< bool > IsCovered(PCB_LAYER_ID aSide) const
DRILL_PROPS & SecondaryDrill()
POST_MACHINING_PROPS & BackPostMachining()
PAD_PROP GetProperty() const
int GetDrillSizeY() const
PAD_ATTRIB GetAttribute() const
VECTOR2I GetPosition() const override
VECTOR2I GetDrillSize() const
int GetDrillSizeX() const
const PADSTACK & Padstack() const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
PAD_DRILL_SHAPE GetDrillShape() const
bool HasHole() const override
const VECTOR2I & GetStart() const
const PADSTACK & Padstack() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
bool IsDrillSlot(const PAD &aPad)
Whether a pad's hole is a slot rather than a round drill.
std::vector< DRILL_SPAN > EnumerateDrillSpans(const BOARD &aBoard, bool aPadBackdrills)
Every drill span present on the board, through-holes first.
std::vector< DRILL_OPERATION > EnumerateDrillOperations(const BOARD &aBoard, const DRILL_QUERY &aQuery)
The one place that decides what the board's holes are.
DRILL_OP_KIND
Which of the padstack's drill props produced the operation.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
static constexpr EDA_ANGLE ANGLE_0
bool IsCopperLayerLowerThan(PCB_LAYER_ID aLayerA, PCB_LAYER_ID aLayerB)
Return true if copper aLayerA is placed lower than aLayerB, false otherwise.
PCB_LAYER_ID
A quick note on layer IDs:
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ CASTELLATED
a pad with a castellated through hole
One machining action, which is also one NC hit and one tool assignment.
DRILL_POST_MACHINING m_BackPostMachining
PCB_LAYER_ID m_BottomLayer
VECTOR2I m_SizeXY
Source axes, never normalized to (width, length).
BOARD_ITEM * m_SourceItem
non-owning, valid only for this enumeration
DRILL_POST_MACHINING m_FrontPostMachining
HOLE_ATTRIBUTE m_Attribute
PCB_LAYER_ID m_DrillStart
PAD_DRILL_POST_MACHINING_MODE m_Mode
Selects which operations EnumerateDrillOperations() returns.
bool m_NonPlatedOnly
Emit only non-plated holes.
bool m_MergePTHNPTH
Emit plated and non-plated together, as the merged drill file does.
bool m_PadMachining
Include pad backdrills and post-machining, kept off for NC drill output.
DRILL_LAYER_PAIR Pair() const
PCB_LAYER_ID DrillEndLayer() const
PCB_LAYER_ID TopLayer() const
PCB_LAYER_ID DrillStartLayer() const
PCB_LAYER_ID BottomLayer() const
The properties of a padstack drill.
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
std::optional< bool > is_capped
True if the drill hole should be capped.
std::optional< bool > is_filled
True if the drill hole should be filled completely.
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
KIBIS top(path, &reporter)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
VECTOR2< int32_t > VECTOR2I