mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2025-09-13 23:59:49 +00:00
add newly generated base models
This commit is contained in:
parent
aa795c4958
commit
911543bea4
9 changed files with 63 additions and 53 deletions
|
@ -16,10 +16,10 @@ module spherical_dish(width, height, depth, inverted){
|
|||
geodesic_sphere(r=depth);
|
||||
}
|
||||
} else {
|
||||
$fa=7;
|
||||
$fa=6.5;
|
||||
// rotate 1 because the bottom of the sphere looks like trash.
|
||||
scale([chord/2/depth, chord/2/depth]) {
|
||||
geodesic_sphere(r=depth);
|
||||
sphere(r=depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
20
src/key.scad
20
src/key.scad
|
@ -13,7 +13,7 @@ color1 = [.2667,.5882,1];
|
|||
color2 = [.5412, .4784, 1];
|
||||
color3 = [.4078, .3569, .749];
|
||||
color4 = [1, .6941, .2];
|
||||
transparent_red = [1,0,0, 0.5];
|
||||
transparent_red = [1,0,0, 0.15];
|
||||
|
||||
// derived values. can't be variables if we want them to change when the special variables do
|
||||
|
||||
|
@ -29,21 +29,19 @@ function top_total_key_height() = $bottom_key_height + (unit * ($key_height - 1)
|
|||
// key shape including dish. used as the ouside and inside shape in keytop(). allows for itself to be shrunk in depth and width / height
|
||||
module shape(thickness_difference, depth_difference){
|
||||
dished(depth_difference, $inverted_dish) {
|
||||
color(color1) shape_hull(thickness_difference, depth_difference, 1);
|
||||
color(color1) shape_hull(thickness_difference, depth_difference, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// shape of the key but with soft, rounded edges. much more realistic, MUCH more complex. orders of magnitude more complex
|
||||
module rounded_shape() {
|
||||
render(){
|
||||
color(color1) minkowski(){
|
||||
// half minkowski. that means the shape is neither circumscribed nor inscribed.
|
||||
shape($minkowski_radius * 2, $minkowski_radius/2);
|
||||
difference(){
|
||||
sphere(r=$minkowski_radius, $fn=24);
|
||||
translate([0,0,-$minkowski_radius]){
|
||||
cube($minkowski_radius * 2, center=true);
|
||||
}
|
||||
color(color1) minkowski(){
|
||||
// half minkowski in the z direction
|
||||
shape($minkowski_radius * 2, $minkowski_radius/2);
|
||||
difference(){
|
||||
sphere(r=$minkowski_radius, $fn=20);
|
||||
translate([0,0,-$minkowski_radius]){
|
||||
cube($minkowski_radius * 2, center=true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,3 +6,18 @@ include <key_profiles/oem.scad>
|
|||
include <key_profiles/dsa.scad>
|
||||
include <key_profiles/sa.scad>
|
||||
include <key_profiles/g20.scad>
|
||||
|
||||
// man, wouldn't it be so cool if functions were first order
|
||||
module key_profile(key_profile_type, row) {
|
||||
if (key_profile_type == "dcs") {
|
||||
dcs_row(row) children();
|
||||
} else if (key_profile_type == "oem") {
|
||||
oem_row(row) children();
|
||||
} else if (key_profile_type == "dsa") {
|
||||
dsa_row(row) children();
|
||||
} else if (key_profile_type == "sa") {
|
||||
sa_row(row) children();
|
||||
} else if (key_profile_type == "g20") {
|
||||
g20_row(row) children();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ module dsa_row(n=3) {
|
|||
$width_difference = 6; // 5.7;
|
||||
$height_difference = 6; // 5.7;
|
||||
$total_depth = 8.1 + abs((n-3) * 1);
|
||||
$top_tilt = (n-3) * -7;
|
||||
$top_tilt = n == 5 ? -21 : (n-3) * 7;
|
||||
$top_skew = 0;
|
||||
$dish_type = "spherical";
|
||||
$dish_depth = 1.2;
|
||||
|
|
|
@ -3,9 +3,9 @@ module g20_row(n=3) {
|
|||
$bottom_key_height = 18.16;
|
||||
$width_difference = 2;
|
||||
$height_difference = 2;
|
||||
$total_depth = 6;
|
||||
$total_depth = 6 + abs((n-3) * 0.5);
|
||||
$top_tilt = 2.5;
|
||||
$top_tilt = (n-3) * -7 + 2.5;
|
||||
$top_tilt = n == 5 ? -18.5 : (n-3) * 7 + 2.5;
|
||||
$top_skew = 0.75;
|
||||
$dish_type = "no dish";
|
||||
$dish_depth = 0;
|
||||
|
@ -13,7 +13,7 @@ module g20_row(n=3) {
|
|||
$dish_skew_y = 0;
|
||||
$minkowski_radius = 1.75;
|
||||
//also,
|
||||
/*$rounded_key = true;*/
|
||||
$rounded_key = true;
|
||||
|
||||
|
||||
children();
|
||||
|
|
|
@ -13,8 +13,9 @@ module sa_row(n=1) {
|
|||
// might wanna change this if you don't minkowski
|
||||
// do you even minkowski bro
|
||||
$corner_radius = 0.25;
|
||||
|
||||
if (n == 1){
|
||||
// 5th row is usually unsculpted or the same as the row below it
|
||||
// making a super-sculpted top row (or bottom row!) would be real easy
|
||||
if (n == 1 || n == 5){
|
||||
$total_depth = 14.89;
|
||||
$top_tilt = -13;
|
||||
children();
|
||||
|
@ -22,7 +23,7 @@ module sa_row(n=1) {
|
|||
$total_depth = 12.925;
|
||||
$top_tilt = -7;
|
||||
children();
|
||||
} else if (n == 3) {
|
||||
} else if (n == 3 || n == 5) {
|
||||
$total_depth = 12.5;
|
||||
$top_tilt = 0;
|
||||
children();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue