Skip to content

Commit 8a7f572

Browse files
committed
[Added] Better drill marks handling
KiCad 8.0.4 now makes them very visible on technical layers
1 parent fd0e211 commit 8a7f572

File tree

6 files changed

+20
-2
lines changed

6 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## [2.5.5] - 2024-09-12
9+
### Added
10+
* Workaround for KiCad 8.0.4 new feature: draw black drill marks on technical layers
11+
812
## [2.5.4] - 2024-05-03
913
### Added
1014
* Workaround for KiCad 8.0.2 computing hidden text when the GUI enabled it

kicad-diff.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@
9999
pcbnew.B_Fab: 'B.Fab',
100100
}
101101
SCHEMATIC_SVG_BASE_NAME = 'Schematic_root'
102+
if hasattr(pcbnew, 'DRILL_MARKS_NO_DRILL_SHAPE'):
103+
NO_DRILL_SHAPE = pcbnew.DRILL_MARKS_NO_DRILL_SHAPE
104+
SMALL_DRILL_SHAPE = pcbnew.DRILL_MARKS_SMALL_DRILL_SHAPE
105+
FULL_DRILL_SHAPE = pcbnew.DRILL_MARKS_FULL_DRILL_SHAPE
106+
elif hasattr(pcbnew, 'PCB_PLOT_PARAMS'):
107+
NO_DRILL_SHAPE = pcbnew.PCB_PLOT_PARAMS.NO_DRILL_SHAPE
108+
SMALL_DRILL_SHAPE = pcbnew.PCB_PLOT_PARAMS.SMALL_DRILL_SHAPE
109+
FULL_DRILL_SHAPE = pcbnew.PCB_PLOT_PARAMS.FULL_DRILL_SHAPE
102110

103111

104112
def SetExcludeEdgeLayer(po, exclude_edge_layer, layer):
@@ -225,10 +233,16 @@ def GenPCBImages(file, file_hash, hash_dir, file_no_ext, layer_names, wanted_lay
225233
# Create the PDF, or use a cached version
226234
if not CheckOptions(name_pdf, cur_pcb_ops) or not isfile(name_pdf):
227235
logger.info('Plotting %s layer' % layer)
228-
pctl.SetLayer(i)
236+
# Plot the edge before, no drill marks (8.0.4 added them)
237+
pctl.SetLayer(Edge_Cuts)
238+
popt.SetDrillMarksType(NO_DRILL_SHAPE)
229239
pctl.OpenPlotfile(layer, plot_format, layer)
230240
pctl.PlotLayer()
231-
pctl.SetLayer(Edge_Cuts)
241+
# Plot the real layer, disable drill marks in silk screen (8.0.4 added them)
242+
pctl.SetLayer(i)
243+
logging.error(i)
244+
logging.error(i > pcbnew.B_Cu)
245+
popt.SetDrillMarksType(NO_DRILL_SHAPE if i > pcbnew.B_Cu else SMALL_DRILL_SHAPE)
232246
pctl.PlotLayer()
233247
pctl.ClosePlot()
234248
if not isfile(name_pdf_kicad):

tests/cases/1/ref_pcb/diff-360.png

-27 Bytes
Loading

tests/cases/1/ref_pcb/diff-370.png

-154 Bytes
Loading

tests/cases/4/ref_pcb/diff-360.png

-51 Bytes
Loading
-43 Bytes
Loading

0 commit comments

Comments
 (0)