Skip to content

Commit 6e5955e

Browse files
authored
Merge pull request #134 from rsheldiii/v2/lexical-scoping-sculpted-fix
V2: Fix lexical scoping in sculpted square in V2.x.x
2 parents 6f1ae47 + 065787e commit 6e5955e

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
@@ -2108,18 +2108,18 @@ function skin_iso_enter_shape(size, delta, progress, thickness_difference) =
21082108
// rounded square shape with additional sculpting functions to better approximate
21092109

21102110
// When sculpting sides, how much in should the tops come
2111-
$side_sculpting_factor = 4.5;
2111+
side_sculpting_factor = 4.5;
21122112
// When sculpting corners, how much extra radius should be added
2113-
$corner_sculpting_factor = 1;
2113+
corner_sculpting_factor = 1;
21142114
// When doing more side sculpting corners, how much extra radius should be added
2115-
$more_side_sculpting_factor = 0.4;
2115+
more_side_sculpting_factor = 0.4;
21162116

21172117

21182118
// side sculpting functions
21192119
// bows the sides out on stuff like SA and DSA keycaps
2120-
function side_sculpting(progress) = (1 - progress) * $side_sculpting_factor;
2120+
function side_sculpting(progress) = (1 - progress) * side_sculpting_factor;
21212121
// makes the rounded corners of the keycap grow larger as they move upwards
2122-
function corner_sculpting(progress) = pow(progress, 2) * $corner_sculpting_factor;
2122+
function corner_sculpting(progress) = pow(progress, 2) * corner_sculpting_factor;
21232123

21242124
module sculpted_square_shape(size, delta, progress) {
21252125
width = size[0];
@@ -2144,7 +2144,7 @@ module sculpted_square_shape(size, delta, progress) {
21442144

21452145
offset(r = extra_corner_radius_this_slice, $fa=360/$shape_facets) {
21462146
offset(r = -extra_corner_radius_this_slice) {
2147-
side_rounded_square(square_size, r = $more_side_sculpting_factor * progress);
2147+
side_rounded_square(square_size, r = more_side_sculpting_factor * progress);
21482148
}
21492149
}
21502150
}
@@ -2199,7 +2199,7 @@ function skin_sculpted_square_shape(size, delta, progress, thickness_difference)
21992199
width - extra_width_this_slice - thickness_difference,
22002200
height - extra_height_this_slice - thickness_difference
22012201
]
2202-
) new_side_rounded_square(square_size, $more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
2202+
) new_side_rounded_square(square_size, more_side_sculpting_factor * progress, extra_corner_radius_this_slice);
22032203

22042204

22052205
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)