Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/pad_resizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,8 +36,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
Expand Down