Merge pull request #32 from rsheldiii/nominal-skinned-iso-enter

nominally support skinned ISO enter
This commit is contained in:
Bob 2020-03-18 17:40:28 -04:00 committed by GitHub
commit ed1b8841fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 6 deletions

View File

@ -107,11 +107,12 @@ function skin_shape_slice(progress, thickness_difference, skew_this_slice, x_ske
transform(
rotation([tilt_this_slice,y_tilt_this_slice,0]),
skin_key_shape([
total_key_width(thickness_difference),
total_key_height(thickness_difference),
total_key_width(0),
total_key_height(0),
],
[$width_difference, $height_difference],
progress
progress,
thickness_difference
)
)
);

View File

@ -44,8 +44,9 @@ module iso_enter() {
$key_height = 2;
$top_tilt = 0;
$stem_support_type = "disable";
$key_shape_type = "iso_enter";
$linear_extrude_shape = true;
/* $linear_extrude_shape = true; */
$linear_extrude_height_adjustment = 19.05 * 0.5;
// this equals (unit_length(1.5) - unit_length(1.25)) / 2
$dish_overdraw_width = 2.38125;

View File

@ -27,9 +27,11 @@ module key_shape(size, delta, progress = 0) {
}
}
function skin_key_shape(size, delta, progress = 0) =
function skin_key_shape(size, delta, progress = 0, thickness_difference) =
$key_shape_type == "rounded_square" ?
skin_rounded_square(size, delta, progress) :
$key_shape_type == "sculpted_square" ?
skin_sculpted_square_shape(size, delta, progress) :
$key_shape_type == "iso_enter" ?
skin_iso_enter_shape(size, delta, progress, thickness_difference) :
echo("Warning: unsupported $key_shape_type for skin shape. disable skin_extrude_shape or pick a new shape");

View File

@ -1,9 +1,10 @@
// corollary is rounded_square
// NOT 3D
function unit_length(length) = unit * (length - 1) + 18.16;
module ISO_enter_shape(size, delta, progress){
width = size[0];
height = size[1];
function unit_length(length) = unit * (length - 1) + 18.16;
// in order to make the ISO keycap shape generic, we are going to express the
@ -32,3 +33,23 @@ module ISO_enter_shape(size, delta, progress){
}
}
}
function iso_enter_vertices(width, height, width_ratio, height_ratio, wd, hd) = [
[ 0-wd, 0-hd], // top right
[ 0-wd, -height+hd], // bottom right
[-width * width_ratio+wd, -height+hd], // bottom left
[-width * width_ratio+wd,-height * height_ratio+hd], // inner middle point
[ -width+wd,-height * height_ratio+hd], // outer middle point
[ -width+wd, 0-hd] // top left
] + [
[(width * width_ratio)/2, height/2 ],
[(width * width_ratio)/2, height/2 ],
[(width * width_ratio)/2, height/2 ],
[(width * width_ratio)/2, height/2 ],
[(width * width_ratio)/2, height/2 ],
[(width * width_ratio)/2, height/2 ]
];
// no rounding on the corners at all
function skin_iso_enter_shape(size, delta, progress, thickness_difference) =
iso_enter_vertices(size.x, size.y, unit_length(1.25) / unit_length(1.5), unit_length(1) / unit_length(2), thickness_difference/2 + delta.x * progress/2, thickness_difference/2 + delta.y * progress/2);