layout script WIP

This commit is contained in:
jaseg 2023-07-05 18:20:44 +02:00
parent c9744004ea
commit 3a2d13fa62
5 changed files with 11995 additions and 30835 deletions

View file

@ -1,30 +1,33 @@
(footprint "bal-10x10mm" (version 20230620) (generator pcbnew)
(layer "F.Cu")
(property "Reference" "REF**" (at 0 -0.5 0 unlocked) (layer "F.SilkS") (tstamp 3359a3e4-31fb-47b9-b16b-0de58bdb9045)
(property "Reference" "REF**" (at 0 -0.5 0 unlocked) (layer "F.SilkS") (tstamp de0f3d4f-0548-4afe-b757-b007f83a9e35)
(effects (font (size 1 1) (thickness 0.1)))
)
(property "Value" "bal-10x10mm" (at 0 1 0 unlocked) (layer "F.Fab") (tstamp 64a76c86-9dcb-403b-9cc1-498db73315bd)
(property "Value" "bal-10x10mm" (at 0 1 0 unlocked) (layer "F.Fab") (tstamp 94288aec-ce17-4e59-976e-5bed69e3739d)
(effects (font (size 1 1) (thickness 0.15)))
)
(property "Footprint" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp 447a31db-e46c-4599-80f8-8228935a2474)
(property "Footprint" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp 18e72dd5-2a40-41d0-80e6-e822e387c67d)
(effects (font (size 1 1) (thickness 0.15)))
)
(property "Datasheet" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp a78abcd1-67b1-46a6-9d26-349df0dd048a)
(property "Datasheet" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp 81b3448f-0b7a-44d9-bd6d-a2750652caea)
(effects (font (size 1 1) (thickness 0.15)))
)
(property "Description" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp 9b04e6e6-2c0a-43b8-aace-405f3681e211)
(property "Description" "" (at 0 0 0 unlocked) (layer "F.Fab") hide (tstamp 52617972-8d1c-497f-9a3d-12806d7165c1)
(effects (font (size 1 1) (thickness 0.15)))
)
(attr smd)
(fp_rect (start -5 -5) (end 5 5)
(stroke (width 0.05) (type default)) (fill none) (layer "F.CrtYd") (tstamp e638c5a1-c193-4c12-b8c5-fc574824dfad))
(fp_text user "${REFERENCE}" (at 0 2.5 0 unlocked) (layer "F.Fab") (tstamp 615c98ba-759a-478e-bee0-2f8fa8dbc4fb)
(stroke (width 0.05) (type default)) (fill none) (layer "F.CrtYd") (tstamp 80d6ffe1-35d8-42e6-a99c-61c162456205))
(fp_text user "${REFERENCE}" (at 0 2.5 0 unlocked) (layer "F.Fab") (tstamp 1dd43b51-1b85-4dbe-a3d5-14a2b02cedd6)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad "1" smd circle (at 0 0) (size 10 10) (layers "F.Cu")
(tstamp 5a84eceb-f684-46f8-b85a-c96eb1f31ff5)
(tstamp fd751de0-95ad-4daa-b946-9bc8a04d145a)
)
(zone (net 0) (net_name "") (layer "F.Cu") (tstamp ed385c04-3160-4b79-9161-5d0c0fd0b46f) (hatch edge 0.5)
(pad "1" smd circle (at 0 0) (size 10 10) (layers "B.Cu")
(tstamp 3c838a9d-3381-4b97-808d-b167edae1cfd)
)
(zone (net 0) (net_name "") (layer "F.Cu") (tstamp 0a2147b6-82c0-4257-a804-2263f1f662b4) (hatch edge 0.5)
(connect_pads (clearance 0))
(min_thickness 0.25) (filled_areas_thickness no)
(keepout (tracks not_allowed) (vias not_allowed) (pads not_allowed) (copperpour not_allowed) (footprints not_allowed))

View file

@ -1,4 +1,4 @@
21311776131427538
21311777255776150
Audio_Module
Reverb_BTDR-1H
Digital Reverberation Unit, http://www.belton.co.kr/inc/downfile.php?seq=17&file=pdf (footprint from http://www.uk-electronic.de/PDF/BTDR-1.pdf)
@ -88505,7 +88505,7 @@ coil_rx
0
18
20
3
footprints
mesh_conn

View file

@ -22,12 +22,14 @@ def parse_si(s, unit=''):
return float(f'{left}.{right or ""}0') * multiplier
b = pcb.Board.open('self-balancing-test-a.kicad_pcb.bak')
b = pcb.Board.open('self-balancing-test-a.kicad_pcb')
b.unfill_zones()
matches = list(b.find_footprints(name='Package_TO_SOT_SMD:SOT-23', sheetfile='resistor_bank.kicad_sch'))
for i, fp in enumerate(matches):
alpha = 2*math.pi * i/len(matches)
fp.at.x, fp.at.y = cx+r, cy
fp.set_rotation(0)
fp.rotate(alpha, cx, cy)
res1, res2 = fp.pads_by_number[3].find_connected(name='Resistor_SMD.*')
@ -35,9 +37,11 @@ for i, fp in enumerate(matches):
res1, res2 = res2, res1
res1.at.x, res1.at.y = cx+r+5, cy+2
res2.at.x, res2.at.y = cx+r+5, cy-2
res1.set_rotation(0)
res1.rotate(alpha, cx, cy)
res2.at.x, res2.at.y = cx+r+5, cy-2
res2.set_rotation(0)
res2.rotate(alpha, cx, cy)
b.write('self-balancing-test-a.testout.kicad_pcb')

File diff suppressed because it is too large Load diff

View file

@ -8782,6 +8782,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 123.19 39.37 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 346247b9-abef-49d1-b13c-f99d72924fa2)
(property "Reference" "H6" (at 125.73 38.1 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 125.73 40.64 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 123.19 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 123.19 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 123.19 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H6") (unit 1)
)
)
)
)
(symbol (lib_id "power:+3V3") (at 231.14 304.8 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid 34f5d4df-4ab7-40f4-8eeb-fb9e9b54964b)
@ -8838,6 +8865,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 123.19 44.45 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 367843df-0569-4288-ab81-4b2205d6fed6)
(property "Reference" "H7" (at 125.73 43.18 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 125.73 45.72 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 123.19 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 123.19 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 123.19 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H7") (unit 1)
)
)
)
)
(symbol (lib_id "power:GND") (at 86.36 336.55 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 36c7ccb9-2db4-414f-8a9b-bbbc7f8e8047)
@ -9319,6 +9373,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 137.16 39.37 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 46b5961b-e9cd-4a38-aa50-a3626436cca1)
(property "Reference" "H8" (at 139.7 38.1 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 139.7 40.64 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 137.16 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 137.16 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 137.16 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H8") (unit 1)
)
)
)
)
(symbol (lib_id "Device:R_Small") (at 342.9 320.04 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 4730e99d-b0cc-497f-aec7-3bb32095d4a3)
@ -12517,6 +12598,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 151.13 44.45 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid b624f70d-fecb-41c6-9c16-1d7b4aec5355)
(property "Reference" "H11" (at 153.67 43.18 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 153.67 45.72 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 151.13 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 151.13 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 151.13 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H11") (unit 1)
)
)
)
)
(symbol (lib_id "power:GND") (at 204.47 341.63 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid b6e2d18f-5d10-4339-9b41-9962d9f08350)
@ -12731,6 +12839,60 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 109.22 44.45 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid bf778f1b-cdc2-462d-b12a-7117bef3cb52)
(property "Reference" "H4" (at 111.76 43.18 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 111.76 45.72 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 109.22 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 109.22 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 109.22 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H4") (unit 1)
)
)
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 151.13 39.37 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid bf9adbc6-e6f6-4d11-b300-44b61a289de1)
(property "Reference" "H10" (at 153.67 38.1 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 153.67 40.64 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 151.13 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 151.13 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 151.13 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H10") (unit 1)
)
)
)
)
(symbol (lib_id "Device:R_Small") (at 508 74.93 270) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid c2cf5361-21b0-4d45-b1aa-09002c392d01)
@ -12821,6 +12983,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 109.22 39.37 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid c5f3bd6c-674d-4084-b503-6be95ee31d0e)
(property "Reference" "H5" (at 111.76 38.1 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 111.76 40.64 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 109.22 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 109.22 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 109.22 39.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H5") (unit 1)
)
)
)
)
(symbol (lib_id "power:GND") (at 502.92 128.27 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid c7739c75-df14-478b-bbf9-1ac9f2ef8fb4)
@ -13530,6 +13719,33 @@
)
)
(symbol (lib_id "Mechanical:MountingHole") (at 137.16 44.45 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid e5b1c07e-4cc5-4a72-b908-c18104733480)
(property "Reference" "H9" (at 139.7 43.18 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "balance" (at 139.7 45.72 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "balancing-footprints:bal-10x10mm" (at 137.16 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 137.16 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Description" "Balancing pad" (at 137.16 44.45 0)
(effects (font (size 1.27 1.27)) hide)
)
(instances
(project "self-balancing-test-a"
(path "/3046137d-98ba-4fe6-98da-3a8a74d99ad5"
(reference "H9") (unit 1)
)
)
)
)
(symbol (lib_id "Amplifier_Operational:MCP602") (at 458.47 241.3 180) (unit 2)
(in_bom yes) (on_board yes) (dnp no)
(uuid e6836819-b178-4592-8dd3-bdd3661d08c2)