Skip to content

Commit bf4ee04

Browse files
authored
Merge pull request #131 from rsheldiii/v1/side-sculpting-scope-fix
V1: Fix lexical scope bug in sculpted_square
2 parents 7edecd7 + 42361f5 commit bf4ee04

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

customizer.scad

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,18 +1960,18 @@ function skin_iso_enter_shape(size, delta, progress, thickness_difference) =
19601960
// rounded square shape with additional sculpting functions to better approximate
19611961

19621962
// When sculpting sides, how much in should the tops come
1963-
$side_sculpting_factor = 4.5;
1963+
side_sculpting_factor = 4.5;
19641964
// When sculpting corners, how much extra radius should be added
1965-
$corner_sculpting_factor = 1;
1965+
corner_sculpting_factor = 1;
19661966
// When doing more side sculpting corners, how much extra radius should be added
1967-
$more_side_sculpting_factor = 0.4;
1967+
more_side_sculpting_factor = 0.4;
19681968

19691969

19701970
// side sculpting functions
19711971
// bows the sides out on stuff like SA and DSA keycaps
1972-
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor;
1972+
function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
19731973
// makes the rounded corners of the keycap grow larger as they move upwards
1974-
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor;
1974+
function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
19751975

19761976
module sculpted_square_shape(size, delta, progress) {
19771977
width = size[0];
@@ -1996,7 +1996,7 @@ module sculpted_square_shape(size, delta, progress) {
19961996

19971997
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
19981998
offset(r = -extra_corner_radius_this_slice) {
1999-
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress);
1999+
side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
20002000
}
20012001
}
20022002
}
@@ -2051,7 +2051,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
20512051
width - extra_width_this_slice - thickness_difference,
20522052
height - extra_height_this_slice - thickness_difference
20532053
]
2054-
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
2054+
) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
20552055

20562056

20572057
module side_rounded_square(size, r) {

src/shapes/sculpted_square.scad

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// rounded square shape with additional sculpting functions to better approximate
22

33
// When sculpting sides, how much in should the tops come
4-
$side_sculpting_factor = 4.5;
4+
side_sculpting_factor = 4.5;
55
// When sculpting corners, how much extra radius should be added
6-
$corner_sculpting_factor = 1;
6+
corner_sculpting_factor = 1;
77
// When doing more side sculpting corners, how much extra radius should be added
8-
$more_side_sculpting_factor = 0.4;
8+
more_side_sculpting_factor = 0.4;
99

1010

1111
// side sculpting functions
1212
// bows the sides out on stuff like SA and DSA keycaps
13-
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor;
13+
function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
1414
// makes the rounded corners of the keycap grow larger as they move upwards
15-
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor;
15+
function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
1616

1717
module sculpted_square_shape(size, delta, progress) {
1818
width = size[0];
@@ -37,7 +37,7 @@ module sculpted_square_shape(size, delta, progress) {
3737

3838
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
3939
offset(r = -extra_corner_radius_this_slice) {
40-
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress);
40+
side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
4141
}
4242
}
4343
}
@@ -92,7 +92,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
9292
width - extra_width_this_slice - thickness_difference,
9393
height - extra_height_this_slice - thickness_difference
9494
]
95-
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
95+
) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
9696

9797

9898
module side_rounded_square(size, r) {

0 commit comments

Comments
 (0)