FEAT: module footprint generation now has silkscreen visible
This commit is contained in:
@@ -153,6 +153,7 @@ for foot in saved:
|
|||||||
pad_map[pad.GetNumber()] = match_num
|
pad_map[pad.GetNumber()] = match_num
|
||||||
|
|
||||||
sorted_foots.append([load_foot, pad_map])
|
sorted_foots.append([load_foot, pad_map])
|
||||||
|
print("Added: ", load_foot)
|
||||||
pcb.Add(load_foot)
|
pcb.Add(load_foot)
|
||||||
|
|
||||||
|
|
||||||
@@ -160,13 +161,13 @@ for foot in saved:
|
|||||||
# sorted_foots.sort(key=lambda foot: foot[0].GetY())
|
# sorted_foots.sort(key=lambda foot: foot[0].GetY())
|
||||||
|
|
||||||
# Export the step file
|
# 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
|
# Import the 3d model of the actual PCB
|
||||||
dummy = FOOTPRINT(pcb)
|
dummy = FOOTPRINT(pcb)
|
||||||
dummy.SetPosition(brd_cent)
|
dummy.SetPosition(brd_cent)
|
||||||
dummy_model = FP_3DMODEL()
|
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_model.m_Offset = VECTOR3D(0.0, 0.0, z_offset)
|
||||||
dummy.Add3DModel(dummy_model)
|
dummy.Add3DModel(dummy_model)
|
||||||
pcb.Add(dummy)
|
pcb.Add(dummy)
|
||||||
@@ -177,8 +178,8 @@ pcb.Add(dummy)
|
|||||||
|
|
||||||
# Save and export step of board + mating connectors
|
# Save and export step of board + mating connectors
|
||||||
SaveBoard("test/test.kicad_pcb", pcb)
|
SaveBoard("test/test.kicad_pcb", pcb)
|
||||||
final_model_path = sys.path[0] + "/../../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".step"
|
final_model_path = sys.path[0] + "/../../libs/melon3d/" + foot_path + ".3dshapes/" + foot_name + ".wrl"
|
||||||
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")
|
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
|
# 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]]
|
# 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]]
|
# 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))
|
# kicad_mod.append(RectLine(start=start, end=end, layer='F.Silkscreen', width=0.05, offset=0.2))
|
||||||
|
|
||||||
# elif shape_type == pcbnew.SHAPE_T_CIRCLE:
|
# elif shape_type == pcbnew.SHAPE_T_CIRCLE:
|
||||||
# start = [cent_mm[0], cent_mm[1] + size_mm[1]/2]
|
# start = [cent_mm[0], cent_mm[1] + size_mm[1]/2]
|
||||||
# end = [start[0], start[1]]
|
# 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))
|
# 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
|
kicad_mod.append(Model(filename=final_model_path
|
||||||
,at=[0,0,-1.6]
|
,at=[0,0,-1.6]
|
||||||
,scale=[1,1,1]
|
,scale=[1,1,1]
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ groups:
|
|||||||
- JLCPCB_compress
|
- JLCPCB_compress
|
||||||
- neo_position
|
- neo_position
|
||||||
- print_pcb
|
- print_pcb
|
||||||
|
- step
|
||||||
- interactive_bom
|
- interactive_bom
|
||||||
|
|
||||||
- name: sch
|
- name: sch
|
||||||
|
|||||||
Reference in New Issue
Block a user