rounded cherry keystem and tweaked numbers. also nice color scheme
This commit is contained in:
parent
16f97911ae
commit
771e4f8c0e
14
key.scad
14
key.scad
|
@ -109,11 +109,11 @@ function top_total_key_height() = $bottom_key_height + (unit * ($key_height - 1)
|
||||||
module shape(thickness_difference, depth_difference){
|
module shape(thickness_difference, depth_difference){
|
||||||
intersection(){
|
intersection(){
|
||||||
dished(depth_difference, $inverted_dish) {
|
dished(depth_difference, $inverted_dish) {
|
||||||
shape_hull(thickness_difference, depth_difference, 1);
|
color([.2667,.5882,1]) shape_hull(thickness_difference, depth_difference, 1);
|
||||||
}
|
}
|
||||||
if ($inverted_dish) {
|
if ($inverted_dish) {
|
||||||
// larger shape_hull to clip off bits of the inverted dish
|
// larger shape_hull to clip off bits of the inverted dish
|
||||||
shape_hull(thickness_difference, 0, 1, 2);
|
color([.5412, .4784, 1]) shape_hull(thickness_difference, 0, 1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ module shape_hull(thickness_difference, depth_difference, modifier, extra_slices
|
||||||
} else {
|
} else {
|
||||||
slices = 10;
|
slices = 10;
|
||||||
for (index = [0:$height_slices - 1 + extra_slices]) {
|
for (index = [0:$height_slices - 1 + extra_slices]) {
|
||||||
color("red") hull() {
|
hull() {
|
||||||
shape_slice(index, $height_slices, thickness_difference, depth_difference, modifier);
|
shape_slice(index, $height_slices, thickness_difference, depth_difference, modifier);
|
||||||
shape_slice(index + 1, $height_slices, thickness_difference, depth_difference, modifier);
|
shape_slice(index + 1, $height_slices, thickness_difference, depth_difference, modifier);
|
||||||
}
|
}
|
||||||
|
@ -173,14 +173,14 @@ module dished(depth_difference, inverted = false) {
|
||||||
union() {
|
union() {
|
||||||
children();
|
children();
|
||||||
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
||||||
dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
color([.4078, .3569, .749]) dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
difference() {
|
difference() {
|
||||||
children();
|
children();
|
||||||
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
||||||
dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
color([.4078, .3569, .749]) dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,11 +213,11 @@ module connectors($stem_profile) {
|
||||||
for (connector_pos = $connectors) {
|
for (connector_pos = $connectors) {
|
||||||
translate([connector_pos[0], connector_pos[1], $stem_inset]) {
|
translate([connector_pos[0], connector_pos[1], $stem_inset]) {
|
||||||
rotate([0, 0, $stem_rotation]){
|
rotate([0, 0, $stem_rotation]){
|
||||||
connector($stem_profile, $has_brim);
|
color([1, .6941, .2]) connector($stem_profile, $has_brim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// used to be difference of the inside() but really I want intersection
|
// cut off anything that isn't underneath the keytop
|
||||||
shape(wall_thickness, keytop_thickness);
|
shape(wall_thickness, keytop_thickness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,9 +412,8 @@ module legend(text, inset=false) {
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*rows = [4,3,2,1,5];
|
rows = [4,3,2,1,5];
|
||||||
|
|
||||||
|
|
||||||
translate_u(0, 0) oem_row(1) cherry() key() {
|
translate_u(0, 0) dcs_row(1) cherry() key() {
|
||||||
cube(2, center=true);
|
};
|
||||||
};*/
|
|
||||||
|
|
57
stems.scad
57
stems.scad
|
@ -1,4 +1,5 @@
|
||||||
// TODO uh what
|
include <util.scad>
|
||||||
|
|
||||||
stem_depth = 24;
|
stem_depth = 24;
|
||||||
|
|
||||||
module brim(has_brim) {
|
module brim(has_brim) {
|
||||||
|
@ -10,39 +11,39 @@ module brim(has_brim) {
|
||||||
if (has_brim) color([0,1,0]) cube([brim_radius, brim_radius, brim_depth]);
|
if (has_brim) color([0,1,0]) cube([brim_radius, brim_radius, brim_depth]);
|
||||||
}
|
}
|
||||||
|
|
||||||
module cherry_stem(has_brim) {
|
module cherry_stem(has_brim, slop = 0.3) {
|
||||||
// the cross is actually a cube with a side length of 4.4
|
|
||||||
cross_length = 4.4;
|
|
||||||
// horizontal cross bar width
|
|
||||||
horizontal_cross_width = 1.4;
|
|
||||||
// vertical cross bar width
|
|
||||||
vertical_cross_width = 1.3;
|
|
||||||
// cross depth, stem height is 3.4mm
|
|
||||||
cross_depth = 4;
|
|
||||||
|
|
||||||
total_stem_width = cross_length + 2.10;
|
stem_width = 7.2 - slop * 2;
|
||||||
total_stem_height = cross_length + 0.5;
|
stem_height = 5.5 - slop * 2;
|
||||||
total_cross_height = cross_length + 0;
|
|
||||||
|
|
||||||
difference(){
|
vertical_cross_width = 1.25;
|
||||||
translate([0,0,stem_inset]) {
|
vertical_cross_length = 3.93;
|
||||||
brim(has_brim);
|
|
||||||
translate([0, 0, cross_depth/2]){
|
|
||||||
cube([total_stem_width, total_stem_height, cross_depth], center=true);
|
|
||||||
|
|
||||||
// 6 and 8 are magic numbers I got from trying to make the sides of the flared part of the stem 45 degree overhangs
|
horizontal_cross_width = 1.15;
|
||||||
translate([0,0,cross_depth/2]) linear_extrude(height=(stem_depth - cross_depth), scale = [6,8]){
|
horizontal_cross_length = 4.03;
|
||||||
square([total_stem_width, total_stem_height], center=true);
|
|
||||||
|
cross_depth = 4;
|
||||||
|
|
||||||
|
stem = [stem_width, stem_height];
|
||||||
|
vertical_cross = [vertical_cross_width, vertical_cross_length + slop + 12];
|
||||||
|
horizontal_cross = [horizontal_cross_length + slop, horizontal_cross_width];
|
||||||
|
|
||||||
|
translate([0,0,stem_inset]) {
|
||||||
|
brim(has_brim);
|
||||||
|
linear_extrude(height = cross_depth) {
|
||||||
|
difference(){
|
||||||
|
roundedSquare(stem, 1, center=true);
|
||||||
|
off = 0;
|
||||||
|
offset(r = off){
|
||||||
|
square(vertical_cross + [-off * 2,-off * 2], center=true);
|
||||||
|
square(horizontal_cross + [-off * 2,-off * 2], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// flared support
|
||||||
//the cross part of the steam
|
// 6 and 8 are magic numbers I got from trying to make the sides of the flared part of the stem 45 degree overhangs
|
||||||
translate([0,0,(cross_depth)/2 + stem_inset]){
|
translate([0,0,cross_depth]) linear_extrude(height=(stem_depth - cross_depth), scale = [6,8]){
|
||||||
cube([vertical_cross_width, total_cross_height, cross_depth], center=true );
|
roundedSquare([stem_width, stem_height], 1, center=true);
|
||||||
cube([cross_length, horizontal_cross_width, cross_depth], center=true );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
util.scad
12
util.scad
|
@ -2,14 +2,18 @@ $fs=.1;
|
||||||
|
|
||||||
//centered
|
//centered
|
||||||
// offset, who knew?
|
// offset, who knew?
|
||||||
module roundedRect(size, radius) {
|
module roundedRect(size, radius, center=true) {
|
||||||
linear_extrude(height = size[2]){
|
linear_extrude(height = size[2]){
|
||||||
offset(r=radius){
|
roundedSquare([size[0], size[1]], radius, center=center);
|
||||||
square([size[0] - radius * 2, size[1] - radius * 2], center=true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module roundedSquare(size, radius, center = true) {
|
||||||
|
offset(r=radius){
|
||||||
|
square([size[0] - radius * 2, size[1] - radius * 2], center=center);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module oldroundedRect(size, radius) {
|
module oldroundedRect(size, radius) {
|
||||||
x = size[0];
|
x = size[0];
|
||||||
y = size[1];
|
y = size[1];
|
||||||
|
|
Loading…
Reference in New Issue