mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2024-11-22 21:23:40 +00:00
Add cherry profile
This commit is contained in:
parent
fa49ee0c70
commit
f4f595c651
@ -588,6 +588,54 @@ module grid_row(row=3, column = 0) {
|
|||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// based off GMK keycap set
|
||||||
|
|
||||||
|
module cherry_row(row=3, column=0) {
|
||||||
|
$bottom_key_width = 18.16;
|
||||||
|
$bottom_key_height = 18.16;
|
||||||
|
$width_difference = $bottom_key_width - 11.85;
|
||||||
|
$height_difference = $bottom_key_height - 14.64;
|
||||||
|
$dish_type = "cylindrical";
|
||||||
|
$dish_depth = 0.65;
|
||||||
|
$dish_skew_x = 0;
|
||||||
|
$dish_skew_y = 0;
|
||||||
|
$top_skew = 2;
|
||||||
|
|
||||||
|
$top_tilt_y = side_tilt(column);
|
||||||
|
extra_height = $double_sculpted ? extra_side_tilt_height(column) : 0;
|
||||||
|
|
||||||
|
// NOTE: cherry keycaps have this stem inset, but I'm reticent to turn it on
|
||||||
|
// since it'll be surprising to folks. the height has been adjusted accordingly
|
||||||
|
// $stem_inset = 0.6;
|
||||||
|
extra_stem_inset_height = max(0.6 - $stem_inset, 0);
|
||||||
|
|
||||||
|
// <= is a hack so you can do these in a for loop. function row = 0
|
||||||
|
if (row <= 1) {
|
||||||
|
$total_depth = 9.8 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 0;
|
||||||
|
|
||||||
|
children();
|
||||||
|
} else if (row == 2) {
|
||||||
|
$total_depth = 7.45 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 2.5;
|
||||||
|
|
||||||
|
children();
|
||||||
|
} else if (row == 3) {
|
||||||
|
$total_depth = 6.55 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 5;
|
||||||
|
children();
|
||||||
|
} else if (row == 3) {
|
||||||
|
$total_depth = 6.7 + 0.65 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 11.5;
|
||||||
|
children();
|
||||||
|
} else if (row >= 4) {
|
||||||
|
$total_depth = 6.7 + 0.65 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 11.5;
|
||||||
|
children();
|
||||||
|
} else {
|
||||||
|
children();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// man, wouldn't it be so cool if functions were first order
|
// man, wouldn't it be so cool if functions were first order
|
||||||
module key_profile(key_profile_type, row, column=0) {
|
module key_profile(key_profile_type, row, column=0) {
|
||||||
@ -605,6 +653,8 @@ module key_profile(key_profile_type, row, column=0) {
|
|||||||
hipro_row(row, column) children();
|
hipro_row(row, column) children();
|
||||||
} else if (key_profile_type == "grid") {
|
} else if (key_profile_type == "grid") {
|
||||||
grid_row(row, column) children();
|
grid_row(row, column) children();
|
||||||
|
} else if (key_profile_type == "cherry") {
|
||||||
|
cherry_row(row, column) children();
|
||||||
} else if (key_profile_type == "disable") {
|
} else if (key_profile_type == "disable") {
|
||||||
children();
|
children();
|
||||||
} else {
|
} else {
|
||||||
@ -656,13 +706,14 @@ module iso_enter() {
|
|||||||
$key_length = 1.5;
|
$key_length = 1.5;
|
||||||
$key_height = 2;
|
$key_height = 2;
|
||||||
|
|
||||||
$top_tilt = 0;
|
$top_tilt = 10;
|
||||||
$stem_support_type = "disable";
|
$stem_support_type = "disable";
|
||||||
$key_shape_type = "iso_enter";
|
$key_shape_type = "iso_enter";
|
||||||
/* $linear_extrude_shape = true; */
|
/* $linear_extrude_shape = true; */
|
||||||
|
/* $skin_extrude_shape = true; */
|
||||||
$linear_extrude_height_adjustment = 19.05 * 0.5;
|
$linear_extrude_height_adjustment = 19.05 * 0.5;
|
||||||
// this equals (unit_length(1.5) - unit_length(1.25)) / 2
|
// this equals (unit_length(1.5) - unit_length(1.25)) / 2
|
||||||
$dish_overdraw_width = 2.38125;
|
$dish_overdraw_width = 13.84125;
|
||||||
|
|
||||||
|
|
||||||
stabilized(vertical=true) {
|
stabilized(vertical=true) {
|
||||||
@ -948,6 +999,7 @@ unit = 19.05;
|
|||||||
// NOT 3D
|
// NOT 3D
|
||||||
function unit_length(length) = unit * (length - 1) + 18.16;
|
function unit_length(length) = unit * (length - 1) + 18.16;
|
||||||
|
|
||||||
|
|
||||||
module ISO_enter_shape(size, delta, progress){
|
module ISO_enter_shape(size, delta, progress){
|
||||||
width = size[0];
|
width = size[0];
|
||||||
height = size[1];
|
height = size[1];
|
||||||
@ -962,19 +1014,21 @@ module ISO_enter_shape(size, delta, progress){
|
|||||||
width_ratio = unit_length(1.25) / unit_length(1.5);
|
width_ratio = unit_length(1.25) / unit_length(1.5);
|
||||||
height_ratio = unit_length(1) / unit_length(2);
|
height_ratio = unit_length(1) / unit_length(2);
|
||||||
|
|
||||||
|
delta = delta / 2;
|
||||||
|
|
||||||
pointArray = [
|
pointArray = [
|
||||||
[ 0, 0], // top right
|
[ 0-delta.x, 0-delta.y], // top right
|
||||||
[ 0, -height], // bottom right
|
[ 0-delta.x, -height+delta.y], // bottom right
|
||||||
[-width * width_ratio, -height], // bottom left
|
[-width * width_ratio+delta.x, -height+delta.y], // bottom left
|
||||||
[-width * width_ratio,-height * height_ratio], // inner middle point
|
[-width * width_ratio + delta.x,-height * height_ratio+delta.y], // inner middle point
|
||||||
[ -width,-height * height_ratio], // outer middle point
|
[ -width + delta.x,-height * height_ratio + delta.y], // outer middle point
|
||||||
[ -width, 0] // top left
|
[ -width + delta.x, 0-delta.y] // top left
|
||||||
];
|
];
|
||||||
|
|
||||||
minkowski(){
|
minkowski(){
|
||||||
circle(r=corner_size);
|
circle(r=$corner_radius);
|
||||||
// gives us rounded inner corner
|
// gives us rounded inner corner
|
||||||
offset(r=-corner_size*2) {
|
offset(r=-$corner_radius*2) {
|
||||||
translate([(width * width_ratio)/2, height/2]) polygon(points=pointArray);
|
translate([(width * width_ratio)/2, height/2]) polygon(points=pointArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1173,7 +1227,7 @@ module rounded_square_shape(size, delta, progress, center = true) {
|
|||||||
// for skin
|
// for skin
|
||||||
|
|
||||||
function skin_rounded_square(size, delta, progress, thickness_difference) =
|
function skin_rounded_square(size, delta, progress, thickness_difference) =
|
||||||
rounded_rectangle_profile(size - (delta * progress), fn=$shape_facets, r=$corner_radius);
|
rounded_rectangle_profile(size - (delta * progress) - [thickness_difference, thickness_difference], fn=$shape_facets, r=$corner_radius);
|
||||||
SMALLEST_POSSIBLE = 1/128;
|
SMALLEST_POSSIBLE = 1/128;
|
||||||
|
|
||||||
// I use functions when I need to compute special variables off of other special variables
|
// I use functions when I need to compute special variables off of other special variables
|
||||||
|
@ -9,6 +9,7 @@ include <key_profiles/sa.scad>
|
|||||||
include <key_profiles/g20.scad>
|
include <key_profiles/g20.scad>
|
||||||
include <key_profiles/hipro.scad>
|
include <key_profiles/hipro.scad>
|
||||||
include <key_profiles/grid.scad>
|
include <key_profiles/grid.scad>
|
||||||
|
include <key_profiles/cherry.scad>
|
||||||
|
|
||||||
// man, wouldn't it be so cool if functions were first order
|
// man, wouldn't it be so cool if functions were first order
|
||||||
module key_profile(key_profile_type, row, column=0) {
|
module key_profile(key_profile_type, row, column=0) {
|
||||||
@ -26,6 +27,8 @@ module key_profile(key_profile_type, row, column=0) {
|
|||||||
hipro_row(row, column) children();
|
hipro_row(row, column) children();
|
||||||
} else if (key_profile_type == "grid") {
|
} else if (key_profile_type == "grid") {
|
||||||
grid_row(row, column) children();
|
grid_row(row, column) children();
|
||||||
|
} else if (key_profile_type == "cherry") {
|
||||||
|
cherry_row(row, column) children();
|
||||||
} else if (key_profile_type == "disable") {
|
} else if (key_profile_type == "disable") {
|
||||||
children();
|
children();
|
||||||
} else {
|
} else {
|
||||||
|
48
src/key_profiles/cherry.scad
Normal file
48
src/key_profiles/cherry.scad
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// based off GMK keycap set
|
||||||
|
|
||||||
|
module cherry_row(row=3, column=0) {
|
||||||
|
$bottom_key_width = 18.16;
|
||||||
|
$bottom_key_height = 18.16;
|
||||||
|
$width_difference = $bottom_key_width - 11.85;
|
||||||
|
$height_difference = $bottom_key_height - 14.64;
|
||||||
|
$dish_type = "cylindrical";
|
||||||
|
$dish_depth = 0.65;
|
||||||
|
$dish_skew_x = 0;
|
||||||
|
$dish_skew_y = 0;
|
||||||
|
$top_skew = 2;
|
||||||
|
|
||||||
|
$top_tilt_y = side_tilt(column);
|
||||||
|
extra_height = $double_sculpted ? extra_side_tilt_height(column) : 0;
|
||||||
|
|
||||||
|
// NOTE: cherry keycaps have this stem inset, but I'm reticent to turn it on
|
||||||
|
// since it'll be surprising to folks. the height has been adjusted accordingly
|
||||||
|
// $stem_inset = 0.6;
|
||||||
|
extra_stem_inset_height = max(0.6 - $stem_inset, 0);
|
||||||
|
|
||||||
|
// <= is a hack so you can do these in a for loop. function row = 0
|
||||||
|
if (row <= 1) {
|
||||||
|
$total_depth = 9.8 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 0;
|
||||||
|
|
||||||
|
children();
|
||||||
|
} else if (row == 2) {
|
||||||
|
$total_depth = 7.45 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 2.5;
|
||||||
|
|
||||||
|
children();
|
||||||
|
} else if (row == 3) {
|
||||||
|
$total_depth = 6.55 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 5;
|
||||||
|
children();
|
||||||
|
} else if (row == 3) {
|
||||||
|
$total_depth = 6.7 + 0.65 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 11.5;
|
||||||
|
children();
|
||||||
|
} else if (row >= 4) {
|
||||||
|
$total_depth = 6.7 + 0.65 - extra_stem_inset_height + extra_height;
|
||||||
|
$top_tilt = 11.5;
|
||||||
|
children();
|
||||||
|
} else {
|
||||||
|
children();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user