Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outer cherry bevel #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/constants.scad
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SMALLEST_POSSIBLE = 1/128;
$fs = .1;
$unit = 19.05;
$zero = 0.01; // used to extrude 2d elements into 3d elements with "zero" height
12 changes: 6 additions & 6 deletions src/key.scad
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ module _dish() {
module envelope(depth_difference=0) {
s = 1.5;
hull(){
cube([total_key_width() * s, total_key_height() * s, 0.01], center = true);
cube([total_key_width() * s, total_key_height() * s, $zero], center = true);
top_placement(SMALLEST_POSSIBLE + depth_difference){
cube([top_total_key_width() * s, top_total_key_height() * s, 0.01], center = true);
cube([top_total_key_width() * s, top_total_key_height() * s, $zero], center = true);
}
}
}
Expand Down Expand Up @@ -307,12 +307,12 @@ module stems_for(positions, stem_type) {
module cherry_keyswitch() {
union() {
hull() {
cube([15.6, 15.6, 0.01], center=true);
translate([0,1,5 - 0.01]) cube([10.5,9.5, 0.01], center=true);
cube([15.6, 15.6, $zero], center=true);
translate([0,1,5 - $zero]) cube([10.5,9.5, $zero], center=true);
}
hull() {
cube([15.6, 15.6, 0.01], center=true);
translate([0,0,-5.5]) cube([13.5,13.5,0.01], center=true);
cube([15.6, 15.6, $zero], center=true);
translate([0,0,-5.5]) cube([13.5,13.5,$zero], center=true);
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion src/settings.scad
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,16 @@ $dish_overdraw_height = 0;

/* [Misc] */
// There's a bevel on the cherry stems to aid insertion / guard against first layer squishing making a hard-to-fit stem.
$cherry_bevel = true;
// Set height to 0 to disable.
$cherry_bevel_height = 0.5;
$cherry_bevel_width = 0.4;

// Add bevel to outside of cherry stems. Set to 0 to disable.
$cherry_outer_bevel_height = 0;
$cherry_outer_bevel_width = $cherry_outer_bevel_height;

// Radius of corner on cherry and box_cherry stems
$cherry_radius = 1;

// How tall in mm the stem support is, if there is any. stem support sits around the keystem and helps to secure it while printing.
$stem_support_height = .8;
Expand Down
13 changes: 9 additions & 4 deletions src/stems/box_cherry.scad
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ include <cherry.scad>
module box_cherry_stem(depth, slop, throw) {
difference(){
// outside shape
linear_extrude(height = depth) {
offset(r=1){
square(outer_box_cherry_stem(slop) - [2,2], center=true);
}
hull() {
translate([0,0,$cherry_outer_bevel_height])
linear_extrude(height = depth-$cherry_outer_bevel_height)
offset(r=$cherry_radius)
square(outer_box_cherry_stem(slop) - [$cherry_radius*2,$cherry_radius*2], center=true);

linear_extrude(height = depth)
offset(r=$cherry_radius-$cherry_outer_bevel_width)
square(outer_box_cherry_stem(slop) - [$cherry_radius*2,$cherry_radius*2], center=true);
}

// inside cross
Expand Down
24 changes: 17 additions & 7 deletions src/stems/cherry.scad
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,31 @@ module inside_cherry_cross(slop) {
}

// Guides to assist insertion and mitigate first layer squishing
if ($cherry_bevel){
if ($cherry_bevel_height){
for (i = cherry_cross(slop, extra_vertical)) hull() {
linear_extrude(height = 0.01, center = false) offset(delta = 0.4) square(i, center=true);
translate([0, 0, 0.5]) linear_extrude(height = 0.01, center = false) square(i, center=true);
linear_extrude(height = $zero, center = false)
offset(delta = $cherry_bevel_width)
square(i, center=true);

translate([0, 0, $cherry_bevel_height-$zero])
linear_extrude(height = $zero, center = false)
square(i, center=true);
}
}
}

module cherry_stem(depth, slop, throw) {
difference(){
// outside shape
linear_extrude(height = depth) {
offset(r=1){
square(outer_cherry_stem(slop) - [2,2], center=true);
}
hull() {
translate([0,0,$cherry_outer_bevel_height])
linear_extrude(height = depth - $cherry_outer_bevel_height)
offset(r=$cherry_radius)
square(outer_cherry_stem(slop) - [$cherry_radius*2,$cherry_radius*2], center=true);

linear_extrude(height = depth, center = false)
offset(r=$cherry_radius-$cherry_outer_bevel_width)
square(outer_cherry_stem(slop) - [$cherry_radius*2,$cherry_radius*2], center=true);
}

inside_cherry_cross($stem_inner_slop);
Expand Down
6 changes: 5 additions & 1 deletion src/stems/rounded_cherry.scad
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ include <cherry.scad>

module rounded_cherry_stem(depth, slop, throw) {
difference(){
cylinder(d=$rounded_cherry_stem_d, h=depth);
hull() {
translate([0,0,$cherry_outer_bevel_height])
cylinder(d=$rounded_cherry_stem_d, h=depth-$cherry_outer_bevel_height);
cylinder(d=$rounded_cherry_stem_d-$cherry_outer_bevel_width*2, h=depth);
}

// inside cross
// translation purely for aesthetic purposes, to get rid of that awful lattice
Expand Down