Skip to content

Commit 89ce262

Browse files
committed
refine customizer
1 parent 2f971dc commit 89ce262

File tree

1 file changed

+30
-24
lines changed
  • CircuitPython_KeyPad_Calculator/design-files/3dprints

1 file changed

+30
-24
lines changed

CircuitPython_KeyPad_Calculator/design-files/3dprints/keycaps.scad

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// entry point for customizer script. This probably isn't useful to most people,
22
// as it's just a wrapper that helps generate customizer.scad for thingiverse.
33

4-
/* [Basic-Settings] */
4+
/* [Hidden] */
55

66
// what preset profile do you wish to use? disable if you are going to set paramters below
77
key_profile = "flat"; // [dcs, oem, dsa, sa, g20, flat, disable]
@@ -13,20 +13,32 @@ legend = "";
1313

1414
$using_customizer = true;
1515

16-
/* [Basic-Settings] */
16+
/* [Hidden] */
1717

1818
// Length in units of key. A regular key is 1 unit; spacebar is usually 6.25
1919
$key_length = 1.0; // Range not working in thingiverse customizer atm [1:0.25:16]
2020

2121
// What type of stem you want. Most people want Cherry.
2222
$stem_type = "cherry"; // [cherry, alps, rounded_cherry, box_cherry, filled, disable]
2323

24+
/* [Stem tuning] */
25+
2426
// The stem is the hardest part to print, so this variable controls how much 'slop' there is in the stem
2527
// if your keycaps stick in the switch raise this value
26-
$stem_slop = 0.50; // Not working in thingiverse customizer atm [0:0.01:1]
28+
$stem_slop = 0.50; // [0:0.01:1]
2729
// broke this out. if your keycaps are falling off lower this value. only works for cherry stems rn
28-
$stem_inner_slop = 0.12;
30+
$stem_inner_slop = 0.12; // [0:0.01:1]
31+
32+
/* [Printing Options] */
2933

34+
orient_for_printing = true;
35+
36+
// Choose -1 to print all rows
37+
print_only_row = -1; // [-1:1:5]
38+
// Choose -1 to print all columns
39+
print_only_column = -1; // [-1:1:4]
40+
41+
/* [Hidden] */
3042
// Font size used for text
3143
$font_size = 7.5;
3244

@@ -48,7 +60,7 @@ $stem_support_type = "disable"; // [tines, brim, disable]
4860
// broken off from artisan support since who wants outset legends?
4961
$outset_legends = false;
5062

51-
/* [Key] */
63+
/* [Hidden] */
5264
// Height in units of key. should remain 1 for most uses
5365
$key_height = 1.0;
5466
// Keytop thickness, aka how many millimeters between the inside and outside of the top surface of the key
@@ -79,7 +91,7 @@ $top_skew = 1.7;
7991
// for double axis sculpted keycaps and probably not much else
8092
$top_skew_x = 0;
8193

82-
/* [Stem] */
94+
/* [Hidden] */
8395

8496
// How far the throw distance of the switch is. determines how far the 'cross' in the cherry switch digs into the stem, and how long the keystem needs to be before supports can start. luckily, alps and cherries have a pretty similar throw. can modify to have stouter keycaps for low profile switches, etc
8597
$stem_throw = 4;
@@ -97,7 +109,7 @@ $stem_rotation = 0;
97109
// keycap. only works on tines right now
98110
$extra_long_stem_support = false;
99111

100-
/* [Shape] */
112+
/* [Hidden] */
101113

102114
// Key shape type, determines the shape of the key. default is 'rounded square'
103115
$key_shape_type = "rounded_square";
@@ -107,7 +119,7 @@ $linear_extrude_height_adjustment = 0;
107119
// If you're doing fancy bowed keycap sides, this controls how many slices you take
108120
$height_slices = 1;
109121

110-
/* [Dish] */
122+
/* [Hidden] */
111123

112124
// What type of dish the key has. note that unlike stems and supports a dish ALWAYS gets rendered.
113125
$dish_type = "disable"; // [cylindrical, spherical, sideways cylindrical, old spherical, disable]
@@ -122,7 +134,7 @@ $dish_overdraw_width = 0;
122134
// Same as width but for height
123135
$dish_overdraw_height = 0;
124136

125-
/* [Misc] */
137+
/* [Hidden] */
126138
// There's a bevel on the cherry stems to aid insertion / guard against first layer squishing making a hard-to-fit stem.
127139
$cherry_bevel = true;
128140

@@ -147,7 +159,7 @@ $minkowski_radius = .33;
147159
// how recessed inset legends / artisans are from the top of the key
148160
$inset_legend_depth = 0.8;
149161

150-
/* [Features] */
162+
/* [Hidden] */
151163

152164
//insert locating bump
153165
$key_bump = false;
@@ -4518,26 +4530,20 @@ module zupside_down(row) {
45184530
}
45194531

45204532
prow = [1, 2, 3, -1, 0];
4521-
printing = 1;
4522-
pitch = printing ? 20 : 18.5;
4523-
if(1)
4524-
for(i=[0:1:4]) {
4525-
echo(i, keys[i]);
4526-
for(j=[0:1:len(keys[i])-1]) {
4527-
//for(j=[1]) {
4533+
pitch = orient_for_printing ? 20 : 18.5;
4534+
print_rows = (print_only_row == -1) ? [0:1:len(keys)-1] : [print_only_row];
4535+
4536+
for(i=print_rows) {
4537+
print_columns = (print_only_column == -1) ? [0:1:len(keys[i])-1] : [print_only_column];
4538+
for(j=print_columns) {
45284539
k = prow[i];
4529-
translate([j*pitch,printing?k*pitch:-i*pitch,0])
4530-
// key_profile(key_profile, row) legend(keys[i][j], $top_tilt=4*(i-2), $total_depth=11.5+2*abs(i-2)) {
4540+
translate([j*pitch,orient_for_printing?k*pitch:-i*pitch,0])
45314541
key_profile(key_profile, 1+i) legend(keys[i][j]) {
4532-
if(printing)
4542+
if(orient_for_printing)
45334543
zupside_down(row)
45344544
key();
45354545
else
45364546
key();
45374547
}
45384548
}
45394549
}
4540-
else
4541-
key_profile(key_profile, row) legend(legend) {
4542-
key();
4543-
}

0 commit comments

Comments
 (0)