Skip to content

Commit

Permalink
Add lasercut support (no switch for this yet, use the variable)
Browse files Browse the repository at this point in the history
  • Loading branch information
choller committed Dec 29, 2017
1 parent f63cb26 commit 07c3722
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
35 changes: 29 additions & 6 deletions includes/default-keycombcuts.scad
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module keycombcut(cutnum, cutlevel) {
module keycombcut(cutnum, cutlevel, lcut1=false, lcut2=false) {
lcut = lcut1 || lcut2;
cutdim = 10;
d = cutdim / sqrt(2); // Diagonal of the cutting rect

Expand All @@ -21,14 +22,20 @@ module keycombcut(cutnum, cutlevel) {

translate([0,0,platspace/2]) // Center the original plateau over the pin
hull() {
translate([0, ycorrect, zcorrect])
rotate([-rotangle1,0,0])
if (!lcut || lcut1) {
// Towards handle
translate([0, ycorrect, zcorrect])
rotate([-rotangle1,0,0])
cube([cutdim,cutdim,cutdim], center=true);
}

translate([0, ycorrect, -zcorrect+cutdim])
translate([0,0,-platspace-addplatspace])
rotate([rotangle1,0,0])
if (!lcut || lcut2) {
// Towards tip of key
translate([0, ycorrect, -zcorrect+cutdim])
translate([0,0,-platspace-addplatspace])
rotate([rotangle1,0,0])
cube([cutdim,cutdim,cutdim], center=true);
}
}
}

Expand All @@ -37,3 +44,19 @@ module keycombcuts() {
keycombcut(i, keycomb[i]);
}
}

module keycombcuts_laser() {
for (i = [0:len(keycomb)-1]) {
if (i < len(keycomb)-1) {
hull() {
keycombcut(i, keycomb[i], false, true);
keycombcut(i+1, keycomb[i+1], true, false);
}
}
}
hull() {
keycombcut(len(keycomb)-1, keycomb[len(keycomb)-1], false, true);
translate([0,0,-kl])
keycombcut(len(keycomb)-1, keycomb[len(keycomb)-1], false, true);
}
}
4 changes: 4 additions & 0 deletions key.scad
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ addcutdepth = bumpkey ? bump_addcutdepth : 0.0;

keycomb = bumpkey ? [0,0,0,0,0,0] : combination;

lasercut = false;

module branding(h) {
linear_extrude(height=h,center=true)
Expand Down Expand Up @@ -92,6 +93,9 @@ union() {

if (!blank) {
keycombcuts();
if (lasercut) {
keycombcuts_laser();
}
}
}
khcyo = -(khcy-ph)/2;
Expand Down

0 comments on commit 07c3722

Please sign in to comment.