upside_down()

also g20 fixes
This commit is contained in:
Bob 2020-01-10 03:07:35 -05:00
parent 60c71c4c86
commit 70df63e145
3 changed files with 17 additions and 4 deletions

View File

@ -179,11 +179,13 @@ module inside() {
}
// put something at the top of the key, with no adjustments for dishing
module top_placement(depth_difference) {
module top_placement(depth_difference=0) {
top_tilt_by_height = -$top_tilt / $key_height;
top_tilt_y_by_length = $double_sculpted ? (-$top_tilt_y / $key_length) : 0;
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
minkowski_height = $rounded_key ? $minkowski_radius : 0;
translate([$top_skew_x + $dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference + minkowski_height/2]){
rotate([top_tilt_by_height, top_tilt_y_by_length,0]){
children();
}

View File

@ -16,8 +16,10 @@ module g20_row(row=3, column = 0) {
//also,
$rounded_key = true;
$top_tilt_y = column * 3 * $double_sculpt_modifier;
$total_depth = 6 + abs((row-3) * 0.5);
$top_tilt_y = side_tilt(column);
extra_height = extra_side_tilt_height(column);
$total_depth = 6 + abs((row-3) * 0.5) + extra_height;
if (row == 5 || row == 0) {

View File

@ -131,3 +131,12 @@ module bump(depth=undef) {
$key_bump_depth = depth == undef ? $key_bump_depth : depth;
children();
}
// kinda dirty, but it works
// might not work great with fully sculpted profiles yet
module upside_down() {
// $top_tilt*2 because top_placement rotates by top_tilt for us
top_placement() rotate([180+$top_tilt*2,0,0]) {
children();
}
}