-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a0ab21c
Showing
17 changed files
with
20,324 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# For PCBs designed using KiCad: http://www.kicad-pcb.org/ | ||
# Format documentation: http://kicad-pcb.org/help/file-formats/ | ||
|
||
# Temporary files | ||
*.000 | ||
*.bak | ||
*.bck | ||
*.kicad_pcb-bak | ||
*.kicad_sch-bak | ||
*.kicad_prl | ||
*.sch-bak | ||
*~ | ||
_autosave-* | ||
*.tmp | ||
*-save.pro | ||
*-save.kicad_pcb | ||
fp-info-cache | ||
|
||
# Netlist files (exported from Eeschema) | ||
*.net | ||
|
||
# Autorouter files (exported from Pcbnew) | ||
*.dsn | ||
*.ses | ||
|
||
# Exported BOM files | ||
*.xml | ||
*.csv | ||
|
||
__pycache__/ | ||
|
||
# Generated CAD files | ||
*.dxf | ||
*.scad | ||
|
||
*.gbr | ||
*.drl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[style] | ||
based_on_style = facebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
%.dxf: %.scad | ||
openscad $< -o $@ | ||
|
||
%.scad: %.py cad.py layout.py | ||
python $< > $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf *.scad *.dxf left/ right/ left.zip right.zip | ||
|
||
.PHONY: case_panels | ||
case_panels: lower_panel.dxf upper_panel.dxf | ||
|
||
.PHONY: pcb_layout | ||
pcb_layout: pcb_outline.dxf | ||
python pcb_layout.py ./hardware/aya.kicad_pcb | ||
|
||
left/left.kicad_pcb: hardware/aya.kicad_pcb | ||
mkdir -p "$(shell dirname $@)" | ||
kikit panelize extractboard -s -220 -25 200 140 $< $@ | ||
|
||
right/right.kicad_pcb: hardware/aya.kicad_pcb | ||
mkdir -p "$(shell dirname $@)" | ||
kikit panelize extractboard -s 20 -25 200 140 $< $@ | ||
|
||
.PHONY: pcb_split | ||
pcb_split: left/left.kicad_pcb right/right.kicad_pcb | ||
|
||
left.zip: left/left.kicad_pcb | ||
zip $@ left/*.gbr left/*.drl | ||
|
||
right.zip: right/right.kicad_pcb | ||
zip $@ right/*.gbr right/*.drl | ||
|
||
.PHONY: pcb_gerbers | ||
pcb_gerbers: left.zip right.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import numpy as np | ||
import solid as sp | ||
|
||
import layout, utils | ||
|
||
|
||
def place_switch(position, orientation): | ||
return sp.translate(position)( | ||
sp.rotate((0, 0, orientation))(sp.square([14, 14], center=True)) | ||
) | ||
|
||
|
||
def switch_cutouts(positions, orientations): | ||
for a in range(0, layout.num_switches): | ||
col, row = divmod(a, layout.matrix_rows) | ||
yield place_switch(positions[col, row], orientations[col, row]) | ||
|
||
|
||
def mcu_header_cutouts(mcu_position): | ||
return sp.translate(mcu_position)( | ||
[ | ||
sp.translate([x, -1.2])(sp.square([4.5, 33], center=True)) | ||
for x in [-7.6, 7.6] | ||
], | ||
) | ||
|
||
|
||
def case_outline(outline): | ||
return sp.minkowski()( | ||
sp.polygon(points=outline), | ||
sp.circle(r=15.), | ||
) | ||
|
||
|
||
def case_panel(outline, mounting_holes): | ||
return sp.difference()( | ||
case_outline(outline), | ||
[ | ||
sp.translate(p)( | ||
sp.circle(d=layout.mounting_hole_diameter, segments=32) | ||
) for p in mounting_holes | ||
], | ||
) |
Oops, something went wrong.