From 6009414e22b224ab73421f632668ef69bfd798e3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 10 Sep 2020 16:42:04 +0200 Subject: [PATCH] Drill files export: ensure the Top to Bottom PTH drill file is always created, even if there are no hole. NPTH file is already always created. Fixes #5566 https://gitlab.com/kicad/code/kicad/issues/5566 --- pcbnew/exporters/gendrill_Excellon_writer.cpp | 4 +++- pcbnew/exporters/gendrill_file_writer_base.cpp | 4 +++- pcbnew/exporters/gendrill_gerber_writer.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pcbnew/exporters/gendrill_Excellon_writer.cpp b/pcbnew/exporters/gendrill_Excellon_writer.cpp index 1318a1bf26..032565c82d 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.cpp +++ b/pcbnew/exporters/gendrill_Excellon_writer.cpp @@ -101,7 +101,9 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, // The file is created if it has holes, or if it is the non plated drill file // to be sure the NPTH file is up to date in separate files mode. - if( getHolesCount() > 0 || doing_npth ) + // Also a PTH drill/map file is always created, to be sure at least one plated hole drill file + // is created (do not create any PTH drill file can be seen as not working drill generator). + if( getHolesCount() > 0 || doing_npth || pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { fn = getDrillFileName( pair, doing_npth, m_merge_PTH_NPTH ); fn.SetPath( aPlotDirectory ); diff --git a/pcbnew/exporters/gendrill_file_writer_base.cpp b/pcbnew/exporters/gendrill_file_writer_base.cpp index c7ccb66326..e33ce6bef1 100644 --- a/pcbnew/exporters/gendrill_file_writer_base.cpp +++ b/pcbnew/exporters/gendrill_file_writer_base.cpp @@ -315,7 +315,9 @@ void GENDRILL_WRITER_BASE::CreateMapFilesSet( const wxString& aPlotDirectory, // The file is created if it has holes, or if it is the non plated drill file // to be sure the NPTH file is up to date in separate files mode. - if( getHolesCount() > 0 || doing_npth ) + // Also a PTH drill file is always created, to be sure at least one plated hole drill file + // is created (do not create any PTH drill file can be seen as not working drill generator). + if( getHolesCount() > 0 || doing_npth || pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { fn = getDrillFileName( pair, doing_npth, m_merge_PTH_NPTH ); fn.SetPath( aPlotDirectory ); diff --git a/pcbnew/exporters/gendrill_gerber_writer.cpp b/pcbnew/exporters/gendrill_gerber_writer.cpp index 3e66f025ed..b8f4ccb4f5 100644 --- a/pcbnew/exporters/gendrill_gerber_writer.cpp +++ b/pcbnew/exporters/gendrill_gerber_writer.cpp @@ -87,7 +87,9 @@ void GERBER_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, // The file is created if it has holes, or if it is the non plated drill file // to be sure the NPTH file is up to date in separate files mode. - if( getHolesCount() > 0 || doing_npth ) + // Also a PTH drill/map file is always created, to be sure at least one plated hole drill file + // is created (do not create any PTH drill file can be seen as not working drill generator). + if( getHolesCount() > 0 || doing_npth || pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { fn = getDrillFileName( pair, doing_npth, false ); fn.SetPath( aPlotDirectory );