FEAT: module footprint generation now has silkscreen visible

This commit is contained in:
ac
2025-05-13 16:16:05 +10:00
parent 18a9c83ca7
commit f17468f13b
2 changed files with 8 additions and 5 deletions

View File

@@ -153,6 +153,7 @@ for foot in saved:
pad_map[pad.GetNumber()] = match_num
sorted_foots.append([load_foot, pad_map])
print("Added: ", load_foot)
pcb.Add(load_foot)
@@ -160,13 +161,13 @@ 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 --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])
os.system("kicad-cli pcb export vrml --units 'tenths' -f --user-origin " + str(ToMM(brd_cent.x)) + "x" + str(ToMM(brd_cent.y)) + "mm -o /tmp/dummy.wrl " + sys.argv[1])
# Import the 3d model of the actual PCB
dummy = FOOTPRINT(pcb)
dummy.SetPosition(brd_cent)
dummy_model = FP_3DMODEL()
dummy_model.m_Filename = "/tmp/dummy.step"
dummy_model.m_Filename = "/tmp/dummy.wrl"
dummy_model.m_Offset = VECTOR3D(0.0, 0.0, z_offset)
dummy.Add3DModel(dummy_model)
pcb.Add(dummy)
@@ -177,8 +178,8 @@ pcb.Add(dummy)
# Save and export step of board + mating connectors
SaveBoard("test/test.kicad_pcb", pcb)
final_model_path = sys.path[0] + "/../../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".step"
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 " + final_model_path + " test/test.kicad_pcb")
final_model_path = sys.path[0] + "/../../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".wrl"
os.system("kicad-cli pcb export vrml -f --units 'mm' --user-origin " + str(ToMM(brd_cent.x)) + "x" + str(ToMM(brd_cent.y)) + "mm -o " + final_model_path + " test/test.kicad_pcb")
# Generate footprint
@@ -249,6 +250,7 @@ for [foot, pad_map] in sorted_foots:
# start = [cent_mm[0] - size_mm[0], cent_mm[1] - size_mm[1]]
# end = [cent_mm[0] + size_mm[0], cent_mm[1] + size_mm[1]]
# kicad_mod.append(RectLine(start=start, end=end, layer='F.Silkscreen', width=0.05, offset=0.2))
# elif shape_type == pcbnew.SHAPE_T_CIRCLE:
# start = [cent_mm[0], cent_mm[1] + size_mm[1]/2]
# end = [start[0], start[1]]
@@ -410,7 +412,7 @@ for i in range(len(corners)):
# kicad_mod.append(RectLine(start=[-brd_width/2,-brd_height/2], end=[brd_width/2,brd_height/2], layer='F.SilkS', width=0.15))
final_model_path = "${KIPRJMOD}/../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".step"
final_model_path = "${KIPRJMOD}/../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".wrl"
kicad_mod.append(Model(filename=final_model_path
,at=[0,0,-1.6]
,scale=[1,1,1]

View File

@@ -260,6 +260,7 @@ groups:
- JLCPCB_compress
- neo_position
- print_pcb
- step
- interactive_bom
- name: sch