Commit eb1efa0e authored by Neil Gershenfeld's avatar Neil Gershenfeld

wip

parent 6b1b241e
Pipeline #4694 passed with stage
in 1 second
......@@ -6,7 +6,7 @@
# usage:
# pcb.py | frep.py [dpi [filename]]
#
# Neil Gershenfeld 10/27/19
# Neil Gershenfeld 12/1/19
# (c) Massachusetts Institute of Technology 2019
#
# This work may be reproduced, modified, distributed,
......@@ -20,9 +20,9 @@
# uncomment for desired output:
#
output = "top, labels, and exterior"
#output = "top, labels, and exterior"
#output = "top, bottom, labels, and exterior"
#output = "top, bottom, labels, holes, and exterior"
output = "top, bottom, labels, holes, and exterior"
#output = "top traces"
#output = "top traces and exterior"
#output = "bottom traces reversed"
......@@ -856,6 +856,7 @@ class text:
#
# to be done
#
shapes['*'] = shape
shapes['~'] = shape
shapes['!'] = shape
shapes['@'] = shape
......@@ -991,11 +992,19 @@ class part:
self.shape = rotate_270(self.shape)
elif (angle != 0):
self.shape = rotate(self.shape,angle)
deg_angle = angle
angle = math.pi*angle/180
self.shape = translate(self.shape,x,y,z)
if hasattr(self,'holes'):
if (angle == 90):
self.holes = rotate_90(self.holes)
elif (angle == 180):
self.holes = rotate_180(self.holes)
elif ((angle == 270) | (angle == -90)):
self.holes = rotate_270(self.holes)
elif (angle != 0):
self.holes = rotate(self.holes,angle)
self.holes = translate(self.holes,x,y,z)
deg_angle = angle
angle = math.pi*angle/180
for i in range(len(self.pad)):
xnew = math.cos(angle)*self.pad[i].x - math.sin(angle)*self.pad[i].y
ynew = math.sin(angle)*self.pad[i].x + math.cos(angle)*self.pad[i].y
......@@ -1165,6 +1174,119 @@ class choke(part):
# connectors
#
class USB_A_plug(part):
#
# USB type A PCB plug
#
def __init__(self,value=''):
self.value = value
self.pad = [point(0,0,0)]
self.labels = []
#
# pin 1: 5V
#
self.shape = translate(cube(-.05,.242,-.02,.02,0,0),0,.138,0)
self.pad.append(point(0,.138,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'5V'))
#
# pin 2: D-
#
self.shape = add(self.shape,translate(cube(-0.05,.202,-.02,.02,0,0),0,.039,0))
self.pad.append(point(0,.039,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'D-'))
#
# pin 3: D+
#
self.shape = add(self.shape,translate(cube(-.05,.202,-.02,.02,0,0),0,-.039,0))
self.pad.append(point(0,-.039,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'D+'))
#
# pin 4: GND
#
self.shape = add(self.shape,translate(cube(-.05,.242,-.02,.02,0,0),0,-.138,0))
self.pad.append(point(0,-.138,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND'))
#
# plug cutout
#
self.holes = cube(-.05,1,.24,1,zb,zt)
self.holes = add(self.holes,cube(-.05,1,-1,-.24,zb,zt))
class header_SWD(part):
#
# Serial Wire Debug programming header
# Amphenol 20021121-00010T1LF 2x5x0.05
#
def __init__(self,value=''):
self.value = value
self.pad = [point(0,0,0)]
self.labels = []
d = 0.077
w = 0.015
h = .047
pad = cube(-h,h,-w,w,0,0)
#
# pin 1: VCC
#
self.shape = translate(pad,d,-.1,0)
self.shape = add(self.shape,cylinder(d+h,-.1,0,0,w))
self.pad.append(point(d,-.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'VCC'))
#
# pin 2: DIO
#
self.shape = add(self.shape,translate(pad,-d,-.1,0))
self.pad.append(point(-d,-.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'DIO'))
#
# pin 3: GND
#
self.shape = add(self.shape,translate(pad,d,-.05,0))
self.pad.append(point(d,-.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND'))
#
# pin 4: CLK
#
self.shape = add(self.shape,translate(pad,-d,-.05,0))
self.pad.append(point(-d,-.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'CLK'))
#
# pin 5: GND
#
self.shape = add(self.shape,translate(pad,d,0,0))
self.pad.append(point(d,0,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND'))
#
# pin 6: SWO
#
self.shape = add(self.shape,translate(pad,-d,0,0))
self.pad.append(point(-d,0,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'SWO'))
#
# pin 7: KEY
#
self.shape = add(self.shape,translate(pad,d,.05,0))
self.pad.append(point(d,.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'KEY'))
#
# pin 8: NC
#
self.shape = add(self.shape,translate(pad,-d,.05,0))
self.pad.append(point(-d,.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'NC'))
#
# pin 9: GND
#
self.shape = add(self.shape,translate(pad,d,.1,0))
self.pad.append(point(d,.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND'))
#
# pin 10: nRESET
#
self.shape = add(self.shape,translate(pad,-d,.1,0))
self.pad.append(point(-d,.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'RST'))
class ESC(part):
#
# ESC 3x1
......@@ -4343,7 +4465,100 @@ class ADXL343(part):
#
# ICs
#
class SAMD11C_SOIC(part):
def __init__(self,value=''):
self.value = value
self.pad = [point(0,0,0)]
self.labels = []
d = 0.11
w = 0.015
h = .03
pad = cube(-h,h,-w,w,0,0)
#
# pin 1: PA05
#
self.shape = translate(pad,-d,.15,0)
self.shape = add(self.shape,cylinder(-d-h,.15,0,0,w))
self.pad.append(point(-d,.15,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A05'))
#
# pin 2: PA08
#
self.shape = add(self.shape,translate(pad,-d,.1,0))
self.pad.append(point(-d,.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A08'))
#
# pin 3: PA09
#
self.shape = add(self.shape,translate(pad,-d,.050,0))
self.pad.append(point(-d,.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A09'))
#
# pin 4: PA14
#
self.shape = add(self.shape,translate(pad,-d,0,0))
self.pad.append(point(-d,0,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A14'))
#
# pin 5: PA15
#
self.shape = add(self.shape,translate(pad,-d,-.05,0))
self.pad.append(point(-d,-.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A15'))
#
# pin 6: nRESET
#
self.shape = add(self.shape,translate(pad,-d,-.1,0))
self.pad.append(point(-d,-.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'RST'))
#
# pin 7: CLK
#
self.shape = add(self.shape,translate(pad,-d,-.15,0))
self.pad.append(point(-d,-.15,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'CLK'))
#
# pin 8: DIO
#
self.shape = add(self.shape,translate(pad,d,-.15,0))
self.pad.append(point(d,-.15,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'DIO'))
#
# pin 9: PA24/D-
#
self.shape = add(self.shape,translate(pad,d,-.1,0))
self.pad.append(point(d,-.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'24-'))
#
# pin 10: PA25/D+
#
self.shape = add(self.shape,translate(pad,d,-.05,0))
self.pad.append(point(d,-.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'25+'))
#
# pin 11: GND
#
self.shape = add(self.shape,translate(pad,d,0,0))
self.pad.append(point(d,0,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'GND'))
#
# pin 12: VCC
#
self.shape = add(self.shape,translate(pad,d,.050,0))
self.pad.append(point(d,.05,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'VCC'))
#
# pin 13: PA02
#
self.shape = add(self.shape,translate(pad,d,.1,0))
self.pad.append(point(d,.1,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A02'))
#
# pin 14: PA04
self.shape = add(self.shape,translate(pad,d,.15,0))
self.pad.append(point(d,.15,0))
self.labels.append(self.text(self.pad[-1].x,self.pad[-1].y,self.pad[-1].z,'A04'))
pad_SOT23_5 = cube(-.01,.01,-.02,.02,0,0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment