Fixed up footprint generation for Kicad8

This commit is contained in:
Andrew Collins
2025-02-03 05:37:32 +00:00
parent 8f6f5b92d2
commit 006278c79f
2 changed files with 4 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ for foot in saved:
# sorted_foots.sort(key=lambda foot: foot[0].GetY())
# Export the step file
os.system("kicad-cli pcb export step -f --subst-models --user-origin " + str(ToMM(brd_cent.x)) + "x" + str(ToMM(brd_cent.y)) + "mm -o /tmp/dummy.step " + sys.argv[1])
os.system("kicad-cli pcb export step -f --no-dnp --subst-models --user-origin " + str(ToMM(brd_cent.x)) + "x" + str(ToMM(brd_cent.y)) + "mm -o /tmp/dummy.step " + sys.argv[1])
# Import the 3d model of the actual PCB
dummy = FOOTPRINT(pcb)
@@ -258,7 +258,8 @@ for [foot, pad_map] in sorted_foots:
# kicad_mod.append(Circle(center=cent_mm, radius=radius, layer='F.Silkscreen', width=0.05))
for d in foot.GraphicalItems():
if type(d) is pcbnew.FP_SHAPE and "F.Courtyard" in d.GetLayerName():
print("Type: ", type(d), "Layer: ", d.GetLayerName())
if type(d) is pcbnew.PCB_SHAPE and "Courtyard" in d.GetLayerName():
shape_type = d.GetShape()
cent = d.GetCenter() - brd_cent
print("Courtyard: ", cent, shape_type)