Skip to content

Commit 0fc43fa

Browse files
committed
use inside() to avoid stems protruding out the sides
1 parent fbcf9b2 commit 0fc43fa

File tree

2 files changed

+18
-29
lines changed

2 files changed

+18
-29
lines changed

customizer.scad

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5991,27 +5991,22 @@ module key(inset = false) {
59915991
if ($clearance_check) %clearance_check();
59925992
}
59935993

5994-
// both stem and support are optional
5995-
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
5996-
dished($keytop_thickness, $inverted_dish) {
5997-
translate([0, 0, $stem_inset]) {
5998-
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
5999-
6000-
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
6001-
}
6002-
}
6003-
}
6004-
6005-
if ($support_type != "disable"){
6006-
inside() {
6007-
translate([0, 0, $stem_inset]) {
5994+
inside() {
5995+
translate([0, 0, $stem_inset]) {
5996+
if ($support_type != "disable"){
60085997
if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type);
60095998

60105999
// always render stem support even if there isn't a stem.
60116000
// rendering flat support w/no stem is much more common than a hollow keycap
60126001
// so if you want a hollow keycap you'll have to turn support off entirely
60136002
support_for($stem_positions, $stem_type);
60146003
}
6004+
6005+
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
6006+
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
6007+
6008+
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
6009+
}
60156010
}
60166011
}
60176012
}

src/key.scad

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -399,28 +399,22 @@ module key(inset = false) {
399399
if ($clearance_check) %clearance_check();
400400
}
401401

402-
// both stem and support are optional
403-
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
404-
inside()
405-
dished($keytop_thickness, $inverted_dish) {
406-
translate([0, 0, $stem_inset]) {
407-
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
408-
409-
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
410-
}
411-
}
412-
}
413-
414-
if ($support_type != "disable"){
415-
inside() {
416-
translate([0, 0, $stem_inset]) {
402+
inside() {
403+
translate([0, 0, $stem_inset]) {
404+
if ($support_type != "disable"){
417405
if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type);
418406

419407
// always render stem support even if there isn't a stem.
420408
// rendering flat support w/no stem is much more common than a hollow keycap
421409
// so if you want a hollow keycap you'll have to turn support off entirely
422410
support_for($stem_positions, $stem_type);
423411
}
412+
413+
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
414+
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
415+
416+
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
417+
}
424418
}
425419
}
426420
}

0 commit comments

Comments
 (0)