Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libraries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
libraries
Commits
5c371cd0
Commit
5c371cd0
authored
6 years ago
by
Neil Gershenfeld
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
22d310f7
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2606
passed
6 years ago
Stage: deploy
Changes
4
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
eagle/eagle_png.py
+0
-0
0 additions, 0 deletions
eagle/eagle_png.py
index.html
+8
-4
8 additions, 4 deletions
index.html
python/frep.py
+85
-0
85 additions, 0 deletions
python/frep.py
python/pcb.py
+4740
-0
4740 additions, 0 deletions
python/pcb.py
with
4833 additions
and
4 deletions
eagle_png.py
→
eagle/
eagle_png.py
+
0
−
0
View file @
5c371cd0
File moved
This diff is collapsed.
Click to expand it.
index.html
+
8
−
4
View file @
5c371cd0
...
@@ -19,16 +19,20 @@ This repository holds libraries of components commonly used in fab classes and l
...
@@ -19,16 +19,20 @@ This repository holds libraries of components commonly used in fab classes and l
<div
style=
"margin-left:5%;margin-right:5%;"
>
<div
style=
"margin-left:5%;margin-right:5%;"
>
<b><a
href=
https://
www.autodesk.com/products
/eagle
>
Eagle
</a>
:
</b>
<a
href=
"eagle/fab.lbr"
>
fab.lbr
</a>
<b><a
href=
https://
gitlab.cba.mit.edu/pub/libraries/tree/master
/eagle
>
Eagle
</a></b>
<p>
<p>
<b><a
href=
http://
kicad-pcb.org
>
KiCad
</a>
:
</b>
<a
href=
"kicad/fab.mod"
>
fab.mod
</a>
<a
href=
"kicad/fab.lib"
>
fab.lib
</a
>
<b><a
href=
http
s
://
gitlab.cba.mit.edu/pub/libraries/tree/master/kicad
>
KiCad
</a></b
>
<p>
<p>
<b><a
href=
http://
kokompe
.cba.mit.edu
>
Kokompe
</a>
:
</b>
<a
href=
kokompe/pcb.cad
>
pcb.cad
</
a
>
<b><a
href=
http
s
://
gitlab
.cba.mit.edu
/pub/libraries/tree/master/kokompe
>
Kokompe
</a>
</
b
>
<p>
<p>
<b><a
href=
https://www.mattkeeter.com/projects/kokopelli
>
Kokopelli
</a>
:
</b>
<a
href=
kokopelli/pcb.py
>
pcb.py
</a>
<b><a
href=
https://gitlab.cba.mit.edu/pub/libraries/tree/master/kokopelli
>
Kokopelli
</a></b>
<p>
<b><a
href=
>
Python</a
></b>
This diff is collapsed.
Click to expand it.
python/frep.py
0 → 100755
+
85
−
0
View file @
5c371cd0
#!/usr/bin/env python
#
# frep.py
# functional representation evaluation
#
# usage
# pcb.py | frep.py [dpi [filename]]
#
# Neil Gershenfeld 10/8/18
# (c) Massachusetts Institute of Technology 2018
#
# This work may be reproduced, modified, distributed,
# performed, and displayed for any purpose, but must
# acknowledge this project. Copyright is retained and
# must be preserved. The work is provided as is; no
# warranty is provided, and users accept all liability.
#
#
# import
#
import
json
,
sys
from
numpy
import
*
from
PIL
import
Image
#
# read input
#
frep
=
json
.
load
(
sys
.
stdin
)
#
# check arguments
#
if
(
frep
[
'
zmin
'
]
!=
frep
[
'
zmax
'
]):
print
(
'
> 2D not (yet) supported
'
)
sys
.
exit
()
if
(
frep
[
'
type
'
]
!=
'
RGB
'
):
print
(
'
types other than RGB not (yet) supported
'
)
sys
.
exit
()
if
(
len
(
sys
.
argv
)
==
1
):
print
(
'
output to out.png at 100 DPI
'
)
filename
=
'
out.png
'
dpi
=
100
elif
(
len
(
sys
.
argv
)
==
2
):
dpi
=
sys
.
argv
[
1
]
filename
=
'
out.png
'
print
(
'
output to out.png at
'
+
dpi
+
'
DPI
'
)
dpi
=
int
(
dpi
)
elif
(
len
(
sys
.
argv
)
==
3
):
dpi
=
sys
.
argv
[
1
]
filename
=
sys
.
argv
[
2
]
print
(
'
output to
'
+
filename
+
'
at
'
+
dpi
+
'
DPI
'
)
dpi
=
int
(
dpi
)
#
# evaluate
#
print
(
'
evaluating ...
'
)
xmin
=
frep
[
'
xmin
'
]
xmax
=
frep
[
'
xmax
'
]
ymin
=
frep
[
'
ymin
'
]
ymax
=
frep
[
'
ymax
'
]
units
=
float
(
frep
[
'
mm_per_unit
'
])
delta
=
(
25.4
/
dpi
)
/
units
x
=
arange
(
xmin
,
xmax
,
delta
)
y
=
flip
(
arange
(
ymin
,
ymax
,
delta
),
0
)
X
=
outer
(
ones
(
y
.
size
),
x
)
Y
=
outer
(
y
,
ones
(
x
.
size
))
Z
=
frep
[
'
zmin
'
]
f
=
eval
(
frep
[
'
function
'
])
#
# construct image
#
m
=
zeros
((
y
.
size
,
x
.
size
,
3
),
dtype
=
uint8
)
m
[:,:,
0
]
=
(
f
&
255
)
m
[:,:,
1
]
=
((
f
>>
8
)
&
255
)
m
[:,:,
2
]
=
((
f
>>
16
)
&
255
)
im
=
Image
.
fromarray
(
m
,
'
RGB
'
)
im
.
save
(
filename
,
dpi
=
[
dpi
,
dpi
])
This diff is collapsed.
Click to expand it.
python/pcb.py
0 → 100755
+
4740
−
0
View file @
5c371cd0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment