From ded7af69daefcc5aa0097f0db4368c88a77039f6 Mon Sep 17 00:00:00 2001 From: Bob - Home - Windows Date: Tue, 5 Dec 2017 20:48:11 -0500 Subject: [PATCH] add dish overdraw to solve incorrect dishing on ISO Enter key due to repositioning the shape to always be centered --- key.scad | 10 ++++++++-- keys.scad | 8 ++++---- shapes.scad | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/key.scad b/key.scad index 1d21406..9abaaff 100644 --- a/key.scad +++ b/key.scad @@ -79,6 +79,10 @@ support_type = "flared"; key_shape_type = "normal"; // ISO enter needs to be linear extruded NOT from the center. this tells the program how far up 'not from the center' is linear_extrude_height_adjustment = 0; +// if you need the dish to extend further, you can 'overdraw' the rectangle it will hit +dish_overdraw_width = 0; +// same as width but for height +dish_overdraw_height = 0; @@ -221,14 +225,14 @@ module dished(depth_difference, inverted = false) { union() { children(); translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){ - color([.4078, .3569, .749]) 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() + $dish_overdraw_width, top_total_key_height() + $dish_overdraw_height, $dish_depth, $inverted_dish, $top_tilt / $key_height); } } } else { difference() { children(); translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){ - color([.4078, .3569, .749]) 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() + $dish_overdraw_width, top_total_key_height() + $dish_overdraw_height, $dish_depth, $inverted_dish, $top_tilt / $key_height); } } } @@ -349,6 +353,8 @@ module example_key(){ $slop = slop; $support_type = support_type; $linear_extrude_height_adjustment = linear_extrude_height_adjustment; + $dish_overdraw_width = dish_overdraw_width; + $dish_overdraw_height = dish_overdraw_height; key(); diff --git a/keys.scad b/keys.scad index ef70907..747cbca 100644 --- a/keys.scad +++ b/keys.scad @@ -48,6 +48,8 @@ $slop = 0.3; $support_type = "bars"; $key_shape_type = "normal"; $linear_extrude_height_adjustment = 0; +$dish_overdraw_width = 0; +$dish_overdraw_height = 0; // key profile definitions @@ -206,13 +208,11 @@ module iso_enter() { $total_depth = 7; $top_tilt = 0; $top_skew = 1.75; - $dish_type = "cylindrical"; - $dish_depth = 1; - $dish_skew_x = 0; - $dish_skew_y = 0; $key_shape_type = "iso_enter"; $linear_extrude_shape = true; $linear_extrude_height_adjustment = 19.05 * 0.5; + // (unit_length(1.5) - unit_length(1.25)) / 2 + $dish_overdraw_width = 2.38125; stabilized(vertical=true) { diff --git a/shapes.scad b/shapes.scad index 21b3a16..a14dd3d 100644 --- a/shapes.scad +++ b/shapes.scad @@ -39,6 +39,8 @@ module ISO_enter(width, height, width_difference, height_difference, corner_size width_ratio = unit_length(1.25) / unit_length(1.5); height_ratio = unit_length(1) / unit_length(2); + echo((unit_length(1.5) - unit_length(1.25))/ 2); + pointArray = [ [ -width_difference/2, -height_difference/2], [ -width_difference/2, -height + height_difference/2],