From 513b6526ff6d27554a33a375bbb74d8078d3c94a Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 18 Jul 2022 09:52:41 -0300 Subject: [PATCH] [PCB Print] Fixed problems with zones on multiple layers - Now we remove them from the layer set Closes #226 --- kibot/out_pcb_print.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/kibot/out_pcb_print.py b/kibot/out_pcb_print.py index 403ad203..9d5188f7 100644 --- a/kibot/out_pcb_print.py +++ b/kibot/out_pcb_print.py @@ -490,9 +490,20 @@ class PCB_PrintOptions(VariantOptions): e.SetLayer(tmp_layer) moved.append(e) for e in list(GS.board.Zones()): + found = False + # Remove from the set + layers = e.GetLayerSet() + if GS.layers_contains(layers, id): + layers.removeLayer(id) + e.SetLayerSet(layers) + removed.append(e) + found = True + # But this isn't enough if the zone is only one layer, move it to another if e.GetLayer() == id: e.SetLayer(tmp_layer) moved.append(e) + found = True + if found: zones.append(e) via_type = 'VIA' if GS.ki5() else 'PCB_VIA' for e in GS.board.GetTracks(): @@ -550,9 +561,20 @@ class PCB_PrintOptions(VariantOptions): e.SetLayer(tmp_layer) moved.append(e) for e in list(GS.board.Zones()): + found = False + # Remove from the set + layers = e.GetLayerSet() + if GS.layers_contains(layers, id): + layers.removeLayer(id) + e.SetLayerSet(layers) + removed.append(e) + found = True + # But this isn't enough if the zone is only one layer, move it to another if e.GetLayer() == id: e.SetLayer(tmp_layer) moved.append(e) + found = True + if found: zones.append(e) via_type = 'VIA' if GS.ki5() else 'PCB_VIA' for e in GS.board.GetTracks():