From b4928f20a64669daa6082b7d8335bde041bfd096 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 May 2024 11:57:56 +0100 Subject: [PATCH] We can only knockout a pad if we're plotting the pad shape. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17166 (cherry picked from commit 0ff59bc60e21f4b6474bf53e1aee08e921fb3df3) --- pcbnew/plot_brditems_plotter.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index fffcd84616..76d29d6974 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -920,23 +920,23 @@ void BRDITEMS_PLOTTER::plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const VE void BRDITEMS_PLOTTER::PlotDrillMarks() { - /* If small drills marks were requested prepare a clamp value to pass - to the helper function */ - int smallDrill = GetDrillMarksType() == DRILL_MARKS::SMALL_DRILL_SHAPE - ? pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) : 0; + bool onCopperLayer = ( LSET::AllCuMask() & m_layerMask ).any(); + int smallDrill = 0; - /* In the filled trace mode drill marks are drawn white-on-black to scrape - the underlying pad. This works only for drivers supporting color change, - obviously... it means that: + if( GetDrillMarksType() == DRILL_MARKS::SMALL_DRILL_SHAPE ) + smallDrill = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ); + + /* In the filled trace mode drill marks are drawn white-on-black to knock-out the underlying + pad. This works only for drivers supporting color change, obviously... it means that: - PS, SVG and PDF output is correct (i.e. you have a 'donut' pad) - In HPGL you can't see them - - In gerbers you can't see them, too. This is arguably the right thing to - do since having drill marks and high speed drill stations is a sure - recipe for broken tools and angry manufacturers. If you *really* want them - you could start a layer with negative polarity to scrape the film. + - In gerbers you can't see them, too. This is arguably the right thing to do since having + drill marks and high speed drill stations is a sure recipe for broken tools and angry + manufacturers. If you *really* want them you could start a layer with negative polarity + to knock-out the film. - In DXF they go into the 'WHITE' layer. This could be useful. */ - if( GetPlotMode() == FILLED ) + if( GetPlotMode() == FILLED && onCopperLayer ) m_plotter->SetColor( WHITE ); for( PCB_TRACK* track : m_board->Tracks() ) @@ -967,6 +967,6 @@ void BRDITEMS_PLOTTER::PlotDrillMarks() } } - if( GetPlotMode() == FILLED ) + if( GetPlotMode() == FILLED && onCopperLayer ) m_plotter->SetColor( BLACK ); }