Added 3rd field for footprint gen, allowing you to disable the 3d model of the added footprint

This commit is contained in:
ac
2025-05-27 17:04:02 +10:00
parent 1828df591f
commit a1564dece5

View File

@@ -53,14 +53,17 @@ for item in pcb.GetDrawings():
foot = foot_sp[0].strip()
offset = (0,0)
# Optional offset tuple
if len(foot_sp) == 2:
if len(foot_sp) > 1:
print("Foot sp: ", foot_sp)
offset = foot_sp[1].strip(" ()").split(',')
print("Offset: ", offset)
offset[0] = FromMM(float(offset[0]))
offset[1] = FromMM(float(offset[1]))
disable_model = False
if len(foot_sp) > 2:
disable_model = eval(foot_sp[2])
new_foots[ref] = [foot, offset]
new_foots[ref] = [foot, offset, disable_model]
# pins = sp[1]
# pin_refs = []
# for pin in pins.split(','):
@@ -126,6 +129,9 @@ for foot in saved:
cent_diff = orig_cent - new_cent
load_foot.SetX(load_foot.GetX() + cent_diff.x + vals[1][0])
load_foot.SetY(load_foot.GetY() + cent_diff.y + vals[1][1])
# Disable model if applicable
if vals[2]:
load_foot.Models().clear()
# Flip the net assignments of the pads
pad_map = {}
for pad in load_foot.Pads():