mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2025-02-16 22:37:03 +00:00
Adding new dishes, a profile clone of MT3 (Matty3), and a second HiPro clone with more accurate dishes.
This commit is contained in:
parent
d1fec7e065
commit
13520c54e3
6 changed files with 194 additions and 4 deletions
|
@ -4,6 +4,8 @@ include <dishes/cylindrical.scad>
|
|||
include <dishes/old_spherical.scad>
|
||||
include <dishes/sideways_cylindrical.scad>
|
||||
include <dishes/spherical.scad>
|
||||
include <dishes/squared_spherical.scad>
|
||||
include <dishes/squared_scoop.scad>
|
||||
include <dishes/flat.scad>
|
||||
include <dishes/3d_surface.scad>
|
||||
|
||||
|
@ -14,11 +16,9 @@ geodesic=false;
|
|||
module dish(width, height, depth, inverted) {
|
||||
if($dish_type == "cylindrical"){
|
||||
cylindrical_dish(width, height, depth, inverted);
|
||||
}
|
||||
else if ($dish_type == "spherical") {
|
||||
} else if ($dish_type == "spherical") {
|
||||
spherical_dish(width, height, depth, inverted);
|
||||
}
|
||||
else if ($dish_type == "sideways cylindrical"){
|
||||
} else if ($dish_type == "sideways cylindrical"){
|
||||
sideways_cylindrical_dish(width, height, depth, inverted);
|
||||
} else if ($dish_type == "old spherical") {
|
||||
old_spherical_dish(width, height, depth, inverted);
|
||||
|
@ -28,6 +28,10 @@ module dish(width, height, depth, inverted) {
|
|||
flat_dish(width, height, depth, inverted);
|
||||
} else if ($dish_type == "disable") {
|
||||
// else no dish
|
||||
} else if ($dish_type == "squared spherical") {
|
||||
squared_spherical_dish(width, height, depth, inverted=inverted);
|
||||
} else if ($dish_type == "squared scoop") {
|
||||
squared_scoop_dish(width, height, depth, inverted=inverted);
|
||||
} else {
|
||||
echo("WARN: $dish_type unsupported");
|
||||
}
|
||||
|
|
71
src/dishes/squared_scoop.scad
Normal file
71
src/dishes/squared_scoop.scad
Normal file
|
@ -0,0 +1,71 @@
|
|||
module squared_scoop_dish(height, width, depth, r=0.5, inverted=false, num=3, den=4){
|
||||
// changable numerator/denoninator on where to place the square's corners
|
||||
// for example, num=2, den=3 means the dish will happen at 1/3 and 2/3 the
|
||||
// width and the height. Defaults to 3/4s. Customizable when calling
|
||||
// this module
|
||||
//
|
||||
// This was initially intended for the scoop on the HiPro, since that's what
|
||||
// it uses. Use "hipro2_row()" if that's what you'd like. However, I do NOT
|
||||
// know how close the inner square is for the HiPro keycaps. In fact, it could
|
||||
// just be a sphere, in which the "squared spherical" scoop is more appropriate.
|
||||
// If, however, it the "squared scoop" makes sense, you can adjust where the square
|
||||
// lands with the num (numerator) and den (denominator) variables. For instance,
|
||||
// "3" and "4" mean 3/4 of the width/height is where the flat part starts.
|
||||
|
||||
chord = pow(pow(height/2, 2) + pow(width/2, 2),0.5);
|
||||
direction = inverted ? -1 : 1;
|
||||
|
||||
//This is the set of points to hull around for the scoop
|
||||
points=[
|
||||
[height/den,width/den, -chord],
|
||||
[num*height/den,width/den,-chord],
|
||||
[height/den,num*width/den, -chord],
|
||||
[num*height/den,num*width/den,-chord]
|
||||
];
|
||||
|
||||
translate([-(width + r) / 2, -(height + r) / 2, 0 * direction])
|
||||
resize([height+r,width+r,depth])
|
||||
hull() {
|
||||
cube([height,width,0.001],center=false);
|
||||
for(i=[0:len(points)-1]) {
|
||||
translate(points[i])
|
||||
sphere(r=r,$fn=64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************** *
|
||||
* ORIGINAL ATTEMPT *
|
||||
* DO NOT USE *
|
||||
* KEPT FOR NOW IF I'M *
|
||||
* MISSING SOMETHING *
|
||||
* ************************** */
|
||||
|
||||
// module squared_scoop_dish(height, width, depth, r=0.5, inverted=false, num=3, den=4){
|
||||
// // changable numerator/denoninator on where to place the square's corners
|
||||
// // for example, num=2, den=3 means the dish will happen at 1/3 and 2/3 the
|
||||
// // width and the height. Defaults to 3/4s. Customizable when calling
|
||||
// // this module
|
||||
|
||||
// chord = pow(pow(height/2, 2) + pow(width/2, 2),0.5);
|
||||
// direction = inverted ? -1 : 1;
|
||||
|
||||
// //This is the set of points to hull around for the scoop
|
||||
// points=[
|
||||
// [height/den,width/den, -chord],
|
||||
// [num*height/den,width/den,-chord],
|
||||
// [height/den,num*width/den, -chord],
|
||||
// [num*height/den,num*width/den,-chord],
|
||||
// [height/2, width/2, -chord - 1]
|
||||
// ];
|
||||
|
||||
// translate([-width / 2, -height / 2, 0 * direction])
|
||||
// resize([height,width,depth])
|
||||
// hull() {
|
||||
// cube([height,width,0.001],center=false);
|
||||
// for(i=[0:len(points)-1]) {
|
||||
// translate(points[i])
|
||||
// sphere(r=r,$fn=64);
|
||||
// }
|
||||
// }
|
||||
// }
|
14
src/dishes/squared_spherical.scad
Normal file
14
src/dishes/squared_spherical.scad
Normal file
|
@ -0,0 +1,14 @@
|
|||
module squared_spherical_dish(width, height, depth, inverted=false) {
|
||||
chord = pow(pow(height / 2, 2) + pow(width / 2, 2),0.5);
|
||||
direction = inverted ? -1 : 1;
|
||||
r=width / 3.5;
|
||||
|
||||
translate([-width / 2, -height / 2, 0 * direction]) {
|
||||
resize([width, height, depth])
|
||||
hull() {
|
||||
cube([width,height,0.001]);
|
||||
translate([width/2, height/2, -chord])
|
||||
sphere(r=r, $fn=64);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,8 @@ include <key_profiles/dsa.scad>
|
|||
include <key_profiles/sa.scad>
|
||||
include <key_profiles/g20.scad>
|
||||
include <key_profiles/hipro.scad>
|
||||
include <key_profiles/hipro2.scad>
|
||||
include <key_profiles/matty3.scad>
|
||||
include <key_profiles/grid.scad>
|
||||
include <key_profiles/cherry.scad>
|
||||
include <key_profiles/dss.scad>
|
||||
|
@ -32,6 +34,10 @@ module key_profile(key_profile_type, row, column=0) {
|
|||
grid_row(row, column) children();
|
||||
} else if (key_profile_type == "cherry") {
|
||||
cherry_row(row, column) children();
|
||||
} else if (key_profile_type == "hipro2") {
|
||||
hipro2_row(row, column) children();
|
||||
} else if (key_profile_type == "matty3") {
|
||||
matty3_row(row, column) children();
|
||||
} else if (key_profile_type == "disable") {
|
||||
children();
|
||||
} else {
|
||||
|
|
43
src/key_profiles/hipro2.scad
Normal file
43
src/key_profiles/hipro2.scad
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Takes rsheldiii's hipro profile and adds the "squared scoop"
|
||||
// dish that appears to be what true HiPros are using up top
|
||||
// Not perfect as it slightly clips the corners of keys
|
||||
module hipro2_row(row=3, column=0) {
|
||||
$key_shape_type = "sculpted_square";
|
||||
|
||||
$bottom_key_width = 18.35;
|
||||
$bottom_key_height = 18.17;
|
||||
|
||||
$width_difference = ($bottom_key_width - 12.3);
|
||||
$height_difference = ($bottom_key_height - 12.65);
|
||||
$dish_type = "squared scoop";
|
||||
$dish_depth = 0.75;
|
||||
$dish_skew_x = 0;
|
||||
$dish_skew_y = 0;
|
||||
$top_skew = 0;
|
||||
$height_slices = 10;
|
||||
$corner_radius = 1;
|
||||
|
||||
$top_tilt_y = side_tilt(column);
|
||||
extra_height = $double_sculpted ? extra_side_tilt_height(column) : 0;
|
||||
|
||||
if (row <= 1){
|
||||
$total_depth = 13.7 + extra_height;
|
||||
// TODO I didn't change these yet
|
||||
$top_tilt = -13;
|
||||
children();
|
||||
} else if (row == 2) {
|
||||
$total_depth = 11.1 + extra_height;
|
||||
$top_tilt = -7;
|
||||
children();
|
||||
} else if (row == 3) {
|
||||
$total_depth = 11.1 + extra_height;
|
||||
$top_tilt = 7;
|
||||
children();
|
||||
} else if (row == 4 || row == 5){
|
||||
$total_depth = 12.25 + extra_height;
|
||||
$top_tilt = 13;
|
||||
children();
|
||||
} else {
|
||||
children();
|
||||
}
|
||||
}
|
52
src/key_profiles/matty3.scad
Normal file
52
src/key_profiles/matty3.scad
Normal file
|
@ -0,0 +1,52 @@
|
|||
// This is an imperfect attempt to clone the MT3 profile
|
||||
// I'm unsure if "MT3" is copyrighted or anything, but
|
||||
// Since my name is "Matt" and "Matty3" sounds like "MT3,"
|
||||
// that's what I'm going with for now
|
||||
module matty3_row(row=3, column=0) {
|
||||
$key_shape_type = "sculpted_square";
|
||||
|
||||
$bottom_key_width = 18.35;
|
||||
$bottom_key_height = 18.6;
|
||||
|
||||
$width_difference = ($bottom_key_width - 13.0);
|
||||
$height_difference = ($bottom_key_height - 13.0);
|
||||
$dish_type = "squared spherical";
|
||||
$dish_depth = 0.75;
|
||||
$dish_skew_x = 0;
|
||||
$dish_skew_y = 0;
|
||||
$top_skew = 0;
|
||||
$height_slices = 10;
|
||||
$corner_radius = 1;
|
||||
|
||||
$top_tilt_y = side_tilt(column);
|
||||
extra_height = $double_sculpted ? extra_side_tilt_height(column) : 0;
|
||||
|
||||
if (row == 0){
|
||||
// TODO I didn't change these yet
|
||||
$total_depth = 14.6 + extra_height;
|
||||
$top_tilt = -12;
|
||||
children();
|
||||
} else if (row == 1) {
|
||||
$total_depth = 13.1 + extra_height;
|
||||
$top_tilt = -6;
|
||||
children();
|
||||
} else if (row == 2) {
|
||||
$total_depth = 10.7 + extra_height;
|
||||
$top_tilt = -6;
|
||||
children();
|
||||
} else if (row == 3) {
|
||||
$total_depth = 10.7 + extra_height;
|
||||
$top_tilt = 6;
|
||||
children();
|
||||
} else if (row == 4){
|
||||
$total_depth = 11.6 + extra_height;
|
||||
$top_tilt = 12;
|
||||
children();
|
||||
} else if (row >= 5) {
|
||||
$total_depth = 11.6 + extra_height;
|
||||
$top_tilt = 0;
|
||||
children();
|
||||
} else {
|
||||
children();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue