Skip to content

Commit 6fd7bdc

Browse files
committed
[PCB Print][Added] Workaround for KiCad 9.0.5 holes
- Change in how holes are plotted when a layer is not included (black instead of white).
1 parent b43ec1e commit 6fd7bdc

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Report: separated N/PTH slot sizes (#824)
2727
- VRML: workaround for KiCad 9 randomly failing to copy 3D models (#804)
2828
- Navigate Results, PCB Print, PcbDraw: Support for big SVGs (#851)
29+
- PCB Print: Workaround for KiCad 9.0.5 change in how holes are plotted when
30+
a layer is not included (black instead of white).
2931

3032
### Fixed
3133
- User.N layer numbering. I.e. pcb_print issues with their numbering (#808)

docs/source/Changelog.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Added
5050
- VRML: workaround for KiCad 9 randomly failing to copy 3D models
5151
(#804)
5252
- Navigate Results, PCB Print, PcbDraw: Support for big SVGs (#851)
53+
- PCB Print: Workaround for KiCad 9.0.5 change in how holes are plotted
54+
when a layer is not included (black instead of white).
5355

5456
Fixed
5557
~~~~~
@@ -509,7 +511,7 @@ Fixed:
509511

510512
- Problems with filters that change fields for components that are
511513
only in the PCB. (#628)
512-
- Use of ’\_none’ filter in lists of filters and \_kf()
514+
- Use of ’_none’ filter in lists of filters and \_kf()
513515

514516
- Variants:
515517

@@ -708,7 +710,7 @@ Changed
708710
- KiRi: continue even on corrupted schematics (#583)
709711
- Variants: avoid W045 on nameless pads. Assuming they are on purpose
710712
and not real pads. (See #584)
711-
- BoardView: Skip footprints with no pads (not just REF*\*)
713+
- BoardView: Skip footprints with no pads (not just REF**)
712714
(whitequark/kicad-boardview#14)
713715

714716
.. _fixed-7:

kibot/out_pcb_print.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import re
3737
import os
3838
import importlib
39-
from pcbnew import B_Cu, B_Mask, F_Cu, F_Mask, FromMM, IsCopperLayer, LSET, PLOT_CONTROLLER, PLOT_FORMAT_SVG
39+
from pcbnew import B_Cu, B_Mask, F_Cu, F_Mask, FromMM, IsCopperLayer, LSET, PLOT_CONTROLLER, PLOT_FORMAT_SVG, VECTOR2I
4040
from shutil import rmtree, copy2
4141
from subprocess import CalledProcessError
4242
import sys
@@ -836,9 +836,14 @@ def plot_vias(self, la, pc, p, filelist, via_t, via_c):
836836
for pad in m.Pads():
837837
layers = pad.GetLayerSet()
838838
if GS.layers_contains(layers, id):
839-
layers.removeLayer(id)
840-
pad.SetLayerSet(layers)
841-
removed.append(pad)
839+
if GS.ki9:
840+
old_size = pad.GetSize()
841+
pad.SetSize(VECTOR2I(0, 0))
842+
removed.append((pad, old_size))
843+
else:
844+
layers.removeLayer(id)
845+
pad.SetLayerSet(layers)
846+
removed.append(pad)
842847
for e in GS.board.GetDrawings():
843848
if e.GetLayer() == id:
844849
e.SetLayer(tmp_layer)
@@ -885,10 +890,14 @@ def plot_vias(self, la, pc, p, filelist, via_t, via_c):
885890
# Restore everything
886891
for e in moved:
887892
e.SetLayer(id)
888-
for pad in removed:
889-
layers = pad.GetLayerSet()
890-
layers.addLayer(id)
891-
pad.SetLayerSet(layers)
893+
if GS.ki9:
894+
for pad, size in removed:
895+
pad.SetSize(size)
896+
else:
897+
for pad in removed:
898+
layers = pad.GetLayerSet()
899+
layers.addLayer(id)
900+
pad.SetLayerSet(layers)
892901
for (via, drill, width, top, bottom) in vias:
893902
via.SetDrill(drill)
894903
GS.set_via_width(via, width)

0 commit comments

Comments
 (0)