Skip to content

Commit

Permalink
Added basic USB cutout
Browse files Browse the repository at this point in the history
  • Loading branch information
mryndzionek committed Feb 19, 2022
1 parent 749a4c1 commit 2fa99b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

# TODO

- [ ] adding USB connector cutout
- [x] adding USB connector cutout
14 changes: 14 additions & 0 deletions keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,20 @@ def generate(config: Config, odir='output'):
"showHidden": False,
}

if not (config.split or config.cnc):
fs = spacerPlate.faces('+Y').all()
fs.sort(key=lambda f: f.edges().val().Center().y)
fs = list(filter(lambda f: math.isclose(
f.edges().val().Center().x, 0.0, abs_tol=1e-09), fs))
assert(len(fs) == 2)
ys = fs[-1].edges().val().Center().y

conn = cq.Workplane('ZX').sketch().push([(config.spacerThickness / 2, 0)])\
.slot(9.0 - 2.56, 2.56, angle=90.0).finalize()\
.extrude(10.0).workplane(offset=-5.0 + 1.5).sketch().push([(config.spacerThickness / 2, 0)])\
.rect(0.5, 15.5).finalize().extrude(15).mirror('ZX').translate((0, ys, 0))
spacerPlate = spacerPlate.cut(conn)

if config.cnc:
switchPlate = switchPlate.faces(">Z").workplane().pushPoints(
shp).hole(config.screwHoleDiameter)
Expand Down

0 comments on commit 2fa99b4

Please sign in to comment.