Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
libraries
Commits
45960ef2
Commit
45960ef2
authored
Oct 17, 2021
by
Neil Gershenfeld
Browse files
update
parent
360317b0
Pipeline
#15910
passed with stage
in 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/pcb.py
View file @
45960ef2
...
...
@@ -6,7 +6,7 @@
# usage:
# pcb.py | frep.py [dpi [filename]]
#
# Neil Gershenfeld
8/30
/21
# Neil Gershenfeld
10/17
/21
#
# This work may be reproduced, modified, distributed,
# performed, and displayed for any purpose, but must
...
...
@@ -19,8 +19,8 @@
# uncomment for desired output
############################################################
output
=
"top, labels, and exterior"
#
output = "top, labels, holes, and exterior"
#
output = "top, labels, and exterior"
output
=
"top, labels, holes, and exterior"
#output = "top, bottom, labels, and exterior"
#output = "top, bottom, labels, holes, and exterior"
#output = "top traces"
...
...
@@ -1226,6 +1226,126 @@ class choke(part):
# connectors
############################################################
class
USB_micro
(
part
):
#
# micro USB
# AMP/FCI 10118194-0001LF
#
def
__init__
(
self
,
value
=
''
):
w
=
0.0049
# pad half width
h
=
.
55
/
25.4
/
2
# pad half height
p
=
.
65
/
25.4
# pad pitch
l
=
0.006
# text
pad_header
=
cube
(
-
w
,
w
,
-
h
,
h
,
0
,
0
)
self
.
value
=
value
self
.
pad
=
[
point
(
0
,
0
,
0
)]
self
.
labels
=
[]
#
# pin 1
#
self
.
shape
=
translate
(
pad_header
,
-
2
*
p
,
0
,
0
)
self
.
pad
.
append
(
point
(
-
2
*
p
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'V'
,
line
=
l
))
#
# pin 2
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
-
p
,
0
,
0
))
self
.
pad
.
append
(
point
(
-
p
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'-'
,
line
=
l
))
#
# pin 3
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,
0
,
0
))
self
.
pad
.
append
(
point
(
0
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'+'
,
line
=
l
))
#
# pin 4
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
p
,
0
,
0
))
self
.
pad
.
append
(
point
(
p
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'I'
,
line
=
l
))
#
# pin 5
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
2
*
p
,
0
,
0
))
self
.
pad
.
append
(
point
(
2
*
p
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'G'
,
line
=
l
))
#
# holes
#
self
.
holes
=
cylinder
(
2.5
/
25.4
,
0
,
zb
,
zt
,
0.016
)
self
.
holes
=
add
(
self
.
holes
,
cylinder
(
-
2.5
/
25.4
,
0
,
zb
,
zt
,
0.016
))
self
.
holes
=
add
(
self
.
holes
,
cylinder
(
-
3.5
/
25.4
,
-
2.7
/
25.4
,
zb
,
zt
,.
9
/
25.4
/
2
))
self
.
holes
=
add
(
self
.
holes
,
cylinder
(
3.5
/
25.4
,
-
2.7
/
25.4
,
zb
,
zt
,.
9
/
25.4
/
2
))
class
header_serial_M
(
part
):
#
# 4x1x0.1 serial cable header
# Sullins GEC36SBSN-M89
#
def
__init__
(
self
,
value
=
''
):
self
.
value
=
value
self
.
pad
=
[
point
(
0
,
0
,
0
)]
self
.
labels
=
[]
#
# pin 1
#
self
.
shape
=
translate
(
pad_header
,
0
,.
15
,
0
)
self
.
pad
.
append
(
point
(
0
,.
15
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'Rx'
))
#
# pin 2
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,.
05
,
0
))
self
.
pad
.
append
(
point
(
0
,.
05
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'Tx'
))
#
# pin 3
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,
-
.
05
,
0
))
self
.
pad
.
append
(
point
(
0
,
-
.
05
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'G'
))
#
# pin 4
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,
-
0.15
,
0
))
self
.
pad
.
append
(
point
(
0
,
-
.
15
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'V'
))
class
header_serial_F
(
part
):
#
# 4x1x0.1 serial cable header
# Sullins GEC36SBSN-M89
#
def
__init__
(
self
,
value
=
''
):
self
.
value
=
value
self
.
pad
=
[
point
(
0
,
0
,
0
)]
self
.
labels
=
[]
#
# pin 1
#
self
.
shape
=
translate
(
pad_header
,
0
,.
15
,
0
)
self
.
pad
.
append
(
point
(
0
,.
15
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'V'
))
#
# pin 2
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,.
05
,
0
))
self
.
pad
.
append
(
point
(
0
,.
05
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'G'
))
#
# pin 3
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,
-
.
05
,
0
))
self
.
pad
.
append
(
point
(
0
,
-
.
05
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'Rx'
))
#
# pin 4
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
0
,
-
0.15
,
0
))
self
.
pad
.
append
(
point
(
0
,
-
.
15
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'Tx'
))
class
header_2H
(
part
):
#
# 2x1x0.1 cable header
...
...
@@ -6078,7 +6198,7 @@ class SAMD21E(part):
self
.
shape
=
translate
(
pad
,
-
d
,
3.5
*
p
,
0
)
self
.
shape
=
add
(
self
.
shape
,
cylinder
(
-
d
-
h
,
3.5
*
p
,
0
,
0
,
w
))
self
.
pad
.
append
(
point
(
-
d
,
3.5
*
p
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'
1
A0'
,
line
=
l
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'
.
A0'
,
line
=
l
))
#
# pin 2
#
...
...
@@ -7954,8 +8074,8 @@ y = 1 # y origin
zt
=
0
# top z
zb
=
-
0.06
# bottom z
w
=
.
015
# wire width
rv
=
0.016
# via
size
rp
=
0.03
# pad
size
rv
=
0.016
# via
radius
rp
=
0.03
# pad
radius
mask
=
.
004
# solder mask size
pcb
=
PCB
(
x
,
y
,
width
,
height
,
mask
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment