161 lines
2.7 KiB
Python
Executable File
161 lines
2.7 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import uuid
|
|
|
|
x1_p=-.475
|
|
y1_p=1.07
|
|
x2_p=-.475
|
|
y2_p=.475
|
|
|
|
x1_g=.475
|
|
y1_g=-.475
|
|
x2_g=.475
|
|
y2_g=-1.07
|
|
|
|
xc=16
|
|
yc=8
|
|
|
|
net={}
|
|
net["+5V"]=1
|
|
net["GND"]=2
|
|
net[1]=4
|
|
net[2]=6
|
|
net[3]=7
|
|
net[4]=8
|
|
net[5]=9
|
|
net[6]=10
|
|
net[7]=11
|
|
net[8]=14
|
|
net[9]=13
|
|
net[10]=12
|
|
net[11]=15
|
|
net[12]=16
|
|
net[13]=17
|
|
net[14]=18
|
|
net[15]=19
|
|
net[16]=20
|
|
net[17]=23
|
|
net[18]=22
|
|
net[19]=24
|
|
net[20]=25
|
|
net[21]=26
|
|
net[22]=27
|
|
net[23]=28
|
|
net[24]=29
|
|
net[25]=30
|
|
net[26]=31
|
|
net[27]=32
|
|
net[28]=33
|
|
net[29]=34
|
|
net[30]=35
|
|
net[31]=36
|
|
net[32]=37
|
|
net[33]=41
|
|
net[34]=39
|
|
net[35]=40
|
|
net[36]=42
|
|
net[37]=43
|
|
net[38]=44
|
|
net[39]=46
|
|
net[40]=47
|
|
net[41]=48
|
|
net[42]=49
|
|
net[43]=50
|
|
net[44]=51
|
|
net[45]=52
|
|
net[46]=53
|
|
net[47]=54
|
|
net[48]=55
|
|
net[49]=21
|
|
net[50]=56
|
|
net[51]=57
|
|
net[52]=58
|
|
net[53]=59
|
|
net[54]=60
|
|
net[55]=61
|
|
net[56]=62
|
|
net[57]=63
|
|
net[58]=64
|
|
net[59]=65
|
|
net[60]=66
|
|
net[61]=67
|
|
net[62]=68
|
|
net[63]=69
|
|
net[64]=70
|
|
net[65]=38
|
|
net[66]=71
|
|
net[67]=72
|
|
net[68]=73
|
|
net[69]=74
|
|
net[70]=75
|
|
net[71]=76
|
|
net[72]=77
|
|
net[73]=78
|
|
net[74]=79
|
|
net[75]=80
|
|
net[76]=81
|
|
net[77]=82
|
|
net[78]=83
|
|
net[79]=84
|
|
net[80]=85
|
|
net[81]=86
|
|
net[82]=87
|
|
net[83]=88
|
|
net[84]=89
|
|
net[85]=90
|
|
net[86]=91
|
|
net[87]=92
|
|
net[88]=93
|
|
net[89]=94
|
|
net[90]=95
|
|
net[91]=96
|
|
net[92]=97
|
|
net[93]=98
|
|
net[94]=99
|
|
net[95]=100
|
|
net[96]=101
|
|
net[97]=102
|
|
net[98]=103
|
|
net[99]=107
|
|
net[100]=106
|
|
net[101]=104
|
|
net[102]=105
|
|
net[103]=108
|
|
net[104]=109
|
|
net[105]=110
|
|
net[106]=111
|
|
net[107]=112
|
|
net[108]=113
|
|
net[109]=114
|
|
net[110]=115
|
|
net[111]=116
|
|
net[112]=117
|
|
net[113]=45
|
|
net[114]=118
|
|
net[115]=119
|
|
net[116]=120
|
|
net[117]=121
|
|
net[118]=122
|
|
net[119]=123
|
|
net[120]=124
|
|
net[121]=125
|
|
net[122]=126
|
|
net[123]=127
|
|
net[124]=128
|
|
net[125]=129
|
|
net[126]=130
|
|
net[127]=131
|
|
net[128]=5
|
|
|
|
for y in range(yc):
|
|
print(f"(segment (start {22.5} {.48+y*3}) (end {22.5} {1.07+y*3}) (width 0.4) (layer \"F.Cu\") (net {net["+5V"]}) (uuid \"{uuid.uuid4()}\"))")
|
|
print(f"(segment (start {22.5} {-.48+y*3}) (end {22.5} {-1.07+y*3}) (width 0.4) (layer \"F.Cu\") (net {net["GND"]}) (uuid \"{uuid.uuid4()}\"))")
|
|
for x in range(xc):
|
|
print(f"(segment (start {x1_p+x*3} {y1_p+y*3}) (end {x2_p+x*3} {y2_p+y*3}) (width 0.4) (layer \"F.Cu\") (net {net["+5V"]}) (uuid \"{uuid.uuid4()}\"))")
|
|
print(f"(segment (start {x1_g+x*3} {y1_g+y*3}) (end {x2_g+x*3} {y2_g+y*3}) (width 0.4) (layer \"F.Cu\") (net {net["GND"]}) (uuid \"{uuid.uuid4()}\"))")
|
|
if x<xc-1:
|
|
print(f"(segment (start {.475+x*3} {.475+y*3}) (end {.945+x*3} {.005+y*3}) (width 0.15) (layer \"F.Cu\") (net {net[y*xc+x+1]}) (uuid \"{uuid.uuid4()}\"))")
|
|
print(f"(segment (start {.945+x*3} {.005+y*3}) (end {2.045+x*3} {.005+y*3}) (width 0.15) (layer \"F.Cu\") (net {net[y*xc+x+1]}) (uuid \"{uuid.uuid4()}\"))")
|
|
print(f"(segment (start {2.045+x*3} {.005+y*3}) (end {2.525+x*3} {-.475+y*3}) (width 0.15) (layer \"F.Cu\") (net {net[y*xc+x+1]}) (uuid \"{uuid.uuid4()}\"))")
|
|
|