4 Commits

Author SHA1 Message Date
Bob
397a3b84fc force ISO enter to render as it does not show in preview 2022-02-19 21:01:19 -05:00
Bob
2c85ea5c07 add todo 2022-02-19 20:41:41 -05:00
Bob
6e5955ed8c Merge pull request #134 from rsheldiii/v2/lexical-scoping-sculpted-fix
V2: Fix lexical scoping in sculpted square in V2.x.x
2022-02-19 20:36:56 -05:00
Bob
065787ee99 fix lexical scoping in sculpted square in V2.x.x 2022-02-19 20:36:26 -05:00
4 changed files with 31 additions and 20 deletions

9
TODO.md Normal file
View File

@@ -0,0 +1,9 @@
TODO:
* Make flat stem support default
* make flat inner shape default
* support repositioning to print on the back surface of the keycap
* implement regular polygon for skin extrusions
* switch to skin-shaped extrusions by default
* kailh choc has a non-square key unit; should I get that working for layouts etc?
* move everything over to layouts requiring a child key
* add an "errors" or "warnings" or "suggestions" echo section in key.scad, right when the key is being made, so the errors don't get lost / repeated

View File

@@ -928,9 +928,10 @@ module iso_enter() {
// this equals (unit_length(1.5) - unit_length(1.25)) / 2
/* $dish_overdraw_width = 2.38125; */
stabilized(vertical=true) {
children();
render() {
stabilized(vertical=true) {
children();
}
}
}
// kind of a catch-all at this point for any directive that doesn't fit in the other files
@@ -2108,18 +2109,18 @@ function skin_iso_enter_shape(size, delta, progress, thickness_difference) =
// rounded square shape with additional sculpting functions to better approximate
// When sculpting sides, how much in should the tops come
$side_sculpting_factor = 4.5;
side_sculpting_factor = 4.5;
// When sculpting corners, how much extra radius should be added
$corner_sculpting_factor = 1;
corner_sculpting_factor = 1;
// When doing more side sculpting corners, how much extra radius should be added
$more_side_sculpting_factor = 0.4;
more_side_sculpting_factor = 0.4;
// side sculpting functions
// bows the sides out on stuff like SA and DSA keycaps
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor;
function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
// makes the rounded corners of the keycap grow larger as they move upwards
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor;
function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
module sculpted_square_shape(size, delta, progress) {
width = size[0];
@@ -2144,7 +2145,7 @@ module sculpted_square_shape(size, delta, progress) {
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
offset(r = -extra_corner_radius_this_slice) {
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress);
side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
}
}
}
@@ -2199,7 +2200,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
width - extra_width_this_slice - thickness_difference,
height - extra_height_this_slice - thickness_difference
]
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
module side_rounded_square(size, r) {

View File

@@ -55,8 +55,9 @@ module iso_enter() {
// this equals (unit_length(1.5) - unit_length(1.25)) / 2
/* $dish_overdraw_width = 2.38125; */
stabilized(vertical=true) {
children();
render() {
stabilized(vertical=true) {
children();
}
}
}

View File

@@ -1,18 +1,18 @@
// rounded square shape with additional sculpting functions to better approximate
// When sculpting sides, how much in should the tops come
$side_sculpting_factor = 4.5;
side_sculpting_factor = 4.5;
// When sculpting corners, how much extra radius should be added
$corner_sculpting_factor = 1;
corner_sculpting_factor = 1;
// When doing more side sculpting corners, how much extra radius should be added
$more_side_sculpting_factor = 0.4;
more_side_sculpting_factor = 0.4;
// side sculpting functions
// bows the sides out on stuff like SA and DSA keycaps
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor;
function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
// makes the rounded corners of the keycap grow larger as they move upwards
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor;
function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
module sculpted_square_shape(size, delta, progress) {
width = size[0];
@@ -37,7 +37,7 @@ module sculpted_square_shape(size, delta, progress) {
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
offset(r = -extra_corner_radius_this_slice) {
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress);
side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
}
}
}
@@ -92,7 +92,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
width - extra_width_this_slice - thickness_difference,
height - extra_height_this_slice - thickness_difference
]
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
module side_rounded_square(size, r) {