From f49218bbe2e33e6aca42587bc98d4420fe431cd4 Mon Sep 17 00:00:00 2001 From: Friedrich Feichtinger Date: Wed, 26 Sep 2018 15:22:00 +0200 Subject: [PATCH 1/3] Fix x/y confusion in example file --- examples/pad_resizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pad_resizer.py b/examples/pad_resizer.py index 0ec0ead..872f839 100755 --- a/examples/pad_resizer.py +++ b/examples/pad_resizer.py @@ -31,8 +31,8 @@ def resize_pads(board, minimal_drill, minimal_annular_ring): pad.size = new_size if annular_size.y < minimal_annular_ring: - new_size = pad.size # currently required because kicad-python cannot do pad.size.x = ... - new_size.x = pad.drill_size.y + minimal_annular_ring + new_size = pad.size # currently required because kicad-python cannot do pad.size.y = ... + new_size.y = pad.drill_size.y + minimal_annular_ring print("* modify size (y) from {} to {}".format(pad.size, new_size)) pad.size = new_size From 73d5620b6b9e3ceca6d4806e89f7e2b4da47074a Mon Sep 17 00:00:00 2001 From: Friedrich Feichtinger Date: Wed, 26 Sep 2018 15:50:39 +0200 Subject: [PATCH 2/3] Fix: skipping of SMD pads in example --- examples/pad_resizer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/pad_resizer.py b/examples/pad_resizer.py index 872f839..259ad93 100755 --- a/examples/pad_resizer.py +++ b/examples/pad_resizer.py @@ -14,6 +14,11 @@ def resize_pads(board, minimal_drill, minimal_annular_ring): print("Resize pads of: {}".format(module)) for pad in module.pads: assert pad.drill_size.x == pad.drill_size.y # we assume round holes + + if pad.drill_size.x == 0: + print("* skip SMD pad") + continue + if pad.drill_size.x < minimal_drill: new_size = Point2D([minimal_drill, minimal_drill]) size_difference = new_size - pad.drill_size From a313d4c339bd77ef90fb55436b82e7f567365f9f Mon Sep 17 00:00:00 2001 From: Friedrich Feichtinger Date: Wed, 26 Sep 2018 17:32:16 +0200 Subject: [PATCH 3/3] fixed indention, mumble mumble... --- examples/pad_resizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pad_resizer.py b/examples/pad_resizer.py index 259ad93..9284a0e 100755 --- a/examples/pad_resizer.py +++ b/examples/pad_resizer.py @@ -16,8 +16,8 @@ def resize_pads(board, minimal_drill, minimal_annular_ring): assert pad.drill_size.x == pad.drill_size.y # we assume round holes if pad.drill_size.x == 0: - print("* skip SMD pad") - continue + print("* skip SMD pad") + continue if pad.drill_size.x < minimal_drill: new_size = Point2D([minimal_drill, minimal_drill])