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
c1acd590
Commit
c1acd590
authored
Oct 27, 2019
by
Neil Gershenfeld
Browse files
wip
parent
a02159ad
Pipeline
#4531
passed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/pcb.py
View file @
c1acd590
...
...
@@ -6,7 +6,7 @@
# usage:
# pcb.py | frep.py [dpi [filename]]
#
# Neil Gershenfeld
9/30
/19
# Neil Gershenfeld
10/27
/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"
...
...
@@ -1165,6 +1165,47 @@ class choke(part):
# connectors
#
class
RCWL0516
(
part
):
#
# RCWL-0516 Doppler radar
#
def
__init__
(
self
,
value
=
''
):
pad_header
=
cube
(
-
.
065
,.
065
,
-
.
025
,.
025
,
0
,
0
)
self
.
value
=
value
self
.
pad
=
[
point
(
0
,
0
,
0
)]
self
.
labels
=
[]
#
# pin 1: 3.3V
#
self
.
shape
=
translate
(
pad_header
,.
107
,
-
.
2
,
0
)
self
.
shape
=
add
(
self
.
shape
,
cylinder
(.
172
,
-
.
2
,
0
,
0
,.
025
))
self
.
pad
.
append
(
point
(.
107
,
-
.
2
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'3.3V'
))
#
# pin 2: GND
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
-
.
107
,
-
.
1
,
0
))
self
.
pad
.
append
(
point
(
-
.
107
,
-
.
1
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'GND'
))
#
# pin 3: OUT
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,.
107
,
0
,
0
))
self
.
pad
.
append
(
point
(.
107
,
0
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'OUT'
))
#
# pin 4: VIN
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,
-
.
107
,.
1
,
0
))
self
.
pad
.
append
(
point
(
-
.
107
,.
1
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'VIN'
))
#
# pin 4: CDS
#
self
.
shape
=
add
(
self
.
shape
,
translate
(
pad_header
,.
107
,.
2
,
0
))
self
.
pad
.
append
(
point
(.
107
,.
2
,
0
))
self
.
labels
.
append
(
self
.
text
(
self
.
pad
[
-
1
].
x
,
self
.
pad
[
-
1
].
y
,
self
.
pad
[
-
1
].
z
,
'CDS'
))
class
microSD
(
part
):
#
# microSD
...
...
@@ -5200,10 +5241,10 @@ elif (output == "bottom traces reversed and exterior"):
outputs
[
"layers"
]
=
[
zb
]
elif
(
output
==
"interior"
):
outputs
[
"function"
]
=
color
(
White
,
pcb
.
interior
)
outputs
[
"layers"
]
=
[
z
b
]
outputs
[
"layers"
]
=
[
z
t
]
elif
(
output
==
"exterior"
):
outputs
[
"function"
]
=
color
(
White
,
pcb
.
exterior
)
outputs
[
"layers"
]
=
[
z
b
]
outputs
[
"layers"
]
=
[
z
t
]
elif
(
output
==
"holes"
):
outputs
[
"function"
]
=
color
(
White
,
subtract
(
add
(
pcb
.
exterior
,
pcb
.
interior
),
pcb
.
holes
))
...
...
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