Skip to content

Commit 583d117

Browse files
committed
XDA profile: 8th time's the charm?
1 parent 3ebbc3b commit 583d117

3 files changed

Lines changed: 34 additions & 16 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.swp
2+
/*.stl
3+
/*.3mf
4+
/*.gcode
5+
/*.diff

keycap_playground.scad

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,30 +54,30 @@ VISUALIZE_LEGENDS = false; // Set to true to have the legends appear via %
5454

5555
// CONSTANTS
5656
KEY_UNIT = 19.05; // Square that makes up the entire space of a key
57-
BETWEENSPACE = 0.8; // The Betweenspace: The void between realms... And keycaps (for an 18.25mm keycap)
57+
BETWEENSPACE = 1; // The Betweenspace: The void between realms... And keycaps (for a 17.9mm XDA keycap, as this seems to overrule the profile's length/width)
5858

5959
// BASIC KEYCAP PARAMETERS
6060
// If you want to make a keycap using a common profile set this to one of: dcs, dss, dsa, kat, kam, riskeycap, gem:
61-
KEY_PROFILE = "riskeycap"; // Any value other than a supported profile (e.g. "dsa") will use the globals specified below. In other words, an empty KEY_PROFILE means "just use the values specified here in this file."
61+
KEY_PROFILE = "xda"; // Any value other than a supported profile (e.g. "dsa") will use the globals specified below. In other words, an empty KEY_PROFILE means "just use the values specified here in this file."
6262
KEY_ROW = 1; // NOTE: For a spacebar make sure you also set DISH_INVERT=true
6363
// Some settings override profile settings but most will be ignored (if using a profile)
6464
KEY_HEIGHT = 9; // The Z (NOTE: Dish values may reduce this a bit as they carve themselves out)
65-
KEY_HEIGHT_EXTRA = 0.0; // If you're planning on sanding the keycap you can use this to make up for lost material (normally this is only useful when using a profile e.g. DSA)
65+
KEY_HEIGHT_EXTRA = 0.08; // If you're planning on sanding the keycap you can use this to make up for lost material (normally this is only useful when using a profile e.g. DSA)
6666
// NOTE: You *can* just set KEY_LENGTH/KEY_WIDTH to something simple e.g. 18
6767
KEY_LENGTH = (KEY_UNIT*1-BETWEENSPACE); // The X (NOTE: Increase DISH_FN if you make this >1U!)
6868
// NOTE: If using a profile make sure KEY_LENGTH matches the profile's KEY_WIDTH for 1U keycaps!
6969
KEY_WIDTH = (KEY_UNIT*1-BETWEENSPACE); // The Y (NOTE: If using POLYGON_EGDES>4 this will be ignored)
7070
// NOTE: Spacebars don't seem to use BETWEENSPACE (for whatever reason). So to make a spacebar just use "KEY_UNIT*<spacebar unit length>" and omit the "-BETWEENSPACE" part. Or just be precise and give it a value like 119.0625 (19.05*6.25)
7171
// NOTE: When making longer keycaps you may need to increase KEY_HEIGHT slightly in order for the height to be accurate. I recommend giving it an extra 0.3mm per extra unit of length so 2U would be +0.3, 3U would be +0.6, etc BUT DOUBLE CHECK IT. Do a side profile view and look at the ruler or render it and double-check the height in your slicer.
7272
//KEY_ROTATION = [0,0,0]; // I *highly* recommend 3D printing keycaps on their front/back/sides! Try this:
73-
KEY_ROTATION = [0,110.1,90]; // An example of how you'd rotate a keycap on its side. Make sure to zoom in on the bottom to make sure it's *actually* going to print flat! This should be the correct rotation for riskeycap profile. For GEM use:
73+
KEY_ROTATION = [0,0,0]; // An example of how you'd rotate a keycap on its side. Make sure to zoom in on the bottom to make sure it's *actually* going to print flat! This should be the correct rotation for riskeycap profile. For GEM use:
7474
//KEY_ROTATION = [0,108.6,90];
7575
// NOTE: If you rotate a keycap to print on its side don't forget to add a built-in support via STEM_SIDE_SUPPORTS! [0,1,0,0] is what you want if you rotated to print on the right side.
7676
KEY_TOP_DIFFERENCE = 5; // How much skinnier the key is at the top VS the bottom [x,y]
7777
KEY_TOP_X = 0; // Move the keycap's top on the X axis (controls skew left/right)
7878
KEY_TOP_Y = 0; // Move the keycap's top on the Y axis (controls skew forward/backward)
7979
WALL_THICKNESS = 0.45*2.25; // Default: 0.45 extrusion width * 2.25 (nice and thick; feels/sounds good). NOTE: STEM_SIDES_WALL_THICKNESS gets added to this.
80-
UNIFORM_WALL_THICKNESS = true; // Much more expensive rendering but the material under the dish will match the sides (even the shape of the dish will be matched)
80+
UNIFORM_WALL_THICKNESS = false; // Much more expensive rendering but the material under the dish will match the sides (even the shape of the dish will be matched)
8181
// NOTE: UNIFORM_WALL_THICKNESS uses WALL_THICKNESS instead of DISH_THICKNESS. So DISH_THICKNESS will be ignored if you enable this option.
8282

8383
// DO THE DISHES!
@@ -121,22 +121,22 @@ STEM_HEIGHT = 4; // How far into the keycap's stem the switch's stem can go (4 i
121121
// NOTE: For Alps you typically want STEM_HEIGHT=3.5 (slightly shorter)
122122
STEM_TOP_THICKNESS = 0.5; // The part that resides under the keycap, connecting stems and keycap together (Note: Only used if UNIFORM_WALL_THICKNESS is false)
123123
// TIP: Increase STEM_TOP_THICKNESS when generating underset masks; makes them easier to use as a modifier in your slicer.
124-
STEM_INSIDE_TOLERANCE = 0.2; // Increases the size of the empty space(s) in the stem
124+
STEM_INSIDE_TOLERANCE = 0.0; // Increases the size of the empty space(s) in the stem
125125
// NOTE: For Alps stems I recommend reducing these two values to something like 0.1 or 0.05:
126126
STEM_OUTSIDE_TOLERANCE_X = 0.05; // Shrinks the stem a bit on the X axis (both axis for round_cherry)
127-
STEM_OUTSIDE_TOLERANCE_Y = 0.05; // Shrinks the stem a bit on th Y axix (unused with round_cherry)
127+
STEM_OUTSIDE_TOLERANCE_Y = 0.05; // Shrinks the stem a bit on the Y axis (unused with round_cherry)
128128
// For box stems (e.g. Kailh box) you want outside tolerances to be equal. For Cherry stems you (usually) want the Y tolerance to be greater (since there's plenty of room on the sides). In fact, you can go *negative* with STEM_OUTSIDE_TOLERANCE_X (e.g. -0.5) for extra strength!
129129
// Probably leave these two alone but they're here if you really love to mess with things:
130130
ALPS_STEM_CORNER_RADIUS = 0.25;
131131
BOX_CHERRY_STEM_CORNER_RADIUS = 0.5;
132132
// Convert to one variable to rule them all (down below):
133133
STEM_CORNER_RADIUS = STEM_TYPE=="alps" ? ALPS_STEM_CORNER_RADIUS : BOX_CHERRY_STEM_CORNER_RADIUS;
134134
// NOTE ABOUT STEM STRENGTH AND ACCURACY: Printing stems upright/flat with a 0.4mm nozzle is troublesome. They work OK but they're usually quite tight. It's better to print keys on their side (front or left/right) so that the layer lines run at an angle to the switch stem; they end up more accurate *and* much, much stronger.
135-
STEM_INSET = 1; // How far to inset the stem (set to 0 to have the stem rest on the build plate which means you won't need supports when printing flat)
135+
STEM_INSET = 1.3; // How far to inset the stem (set to 0 to have the stem rest on the build plate which means you won't need supports when printing flat)
136136
STEM_FLAT_SUPPORT = false; // Add built-in support for the stem when printing flat (if inset)
137137
STEM_SIDE_SUPPORT_THICKNESS = 1; // 1 works well for most things
138138
// This controls which sides get (internal, under-the-top) stem supports (for printing on the side):
139-
STEM_SIDE_SUPPORTS = [0,1,0,0]; // Left, right, front, back
139+
STEM_SIDE_SUPPORTS = [0,0,0,0]; // Left, right, front, back
140140
// NOTE: You can only enable left/right supports *or* front/back supports. Not both at the same time. (TODO: Fix that... Maybe? Why would you ever need *both* say, a left support *and* a top support at the same time?)
141141
STEM_SUPPORT_DISTANCE = 0.2; // Controls the air gap between the stem and its support
142142
// NOTE: If printing with a small nozzle like 0.25mm you might want to set the support distance to 0 to prevent "misses".
@@ -147,6 +147,10 @@ STEM_LOCATIONS = [ // Where to place stems/stabilizers
147147
// [0,12,0], [0,-12,0], // Standard 2U Numpad + or Enter
148148
// [50,0,0], [-50,0,0], // Cherry style 6.25U spacebar (most common)
149149
// [57,0,0], [-57,0,0], // Cherry style 7U spacebar
150+
// [12,0,0], [-12,0,0] // ISO enter
151+
// [-KEY_UNIT / 2, 0, 0], [KEY_UNIT / 2, 0, 0] // 2u across 2 switches
152+
// [0, -KEY_UNIT / 2, 0], [0, KEY_UNIT / 2, 0] // 2u across 2 switches, vertical
153+
// [((1.75 - 1.25)/2)*KEY_UNIT, 0, 0] // stepped caps on a non-stepped caps layout
150154
];
151155
// SNAP-FIT STEM STUFF (see snap_fit.scad for more details)
152156
STEM_SNAP_FIT = false; // If you want to print the stem as a separate part
@@ -159,7 +163,7 @@ HOMING_DOT_LENGTH = 0; // Set to something like "3" for a good, easy-to-feel "do
159163
HOMING_DOT_WIDTH = 1; // Default: 1
160164
HOMING_DOT_X = 0; // 0 == Center
161165
HOMING_DOT_Y = -KEY_WIDTH/4; // Default: Move it down towards the front a bit
162-
HOMING_DOT_Z = -0.35; // 0 == Right at KEY_HEIGHT (dish type makes a big difference here)
166+
HOMING_DOT_Z = 0.2; // 0 == Right at KEY_HEIGHT (dish type makes a big difference here)
163167
// NOTE: ADA specifies 0.5mm as the ideal braille dot height so that's what I recommend for homing dots too! Though, 0.3mm seems to be reasonably "feelable" in my testing. Experiment!
164168

165169
// LEGENDARY!
@@ -1636,4 +1640,4 @@ render_keycap(RENDER);
16361640
* Riskeycap profile has been updated to the latest version (5.0). This is the result of much typing and experimentation.
16371641
1.0:
16381642
* Initial release of the Keycap Playgound.
1639-
*/
1643+
*/

profiles.scad

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,18 @@ module GEM_stem(stem_type="box_cherry", key_height=8.2, key_length=18.25, key_wi
14101410
}
14111411
}
14121412

1413-
module XDA_keycap(row=1, length=18.41, width=18.41, height_extra=0, wall_thickness=1.5, dish_thickness=1.5, dish_fn=$preview ? 28 : 256, dish_corner_fn=$preview ? 16 : 64, dish_depth=1, dish_invert=false, stem_clips=false, stem_walls_inset=0, stem_walls_tolerance=0.25, top_difference=19.05/5, key_rotation=[0,0,0], corner_radius=0.3, corner_radius_curve=8, legends=[""], legend_font_sizes=[6], legend_fonts=["Roboto"], legend_trans=[[0,0,0]], legend_trans2=[[0,0,0]], legend_rotation=[[0,0,0]], legend_rotation2=[[0,0,0]], legend_scale=[[0,0,0]], legend_underset=[[0,0,0]], legend_carved=false, homing_dot_length=0, homing_dot_width=0, homing_dot_x=0, homing_dot_y=0, homing_dot_z=0, polygon_layers=10, visualize_legends=false, uniform_wall_thickness=true, debug=false) {
1413+
module XDA_keycap(
1414+
row=1, length=17.9, width=17.9, height_extra=0, top_difference=4.15, wall_thickness=1.5, uniform_wall_thickness=true, key_rotation=[0,0,0],
1415+
dish_thickness=1.5, dish_fn=$preview ? 28 : 256, dish_corner_fn=$preview ? 16 : 64, dish_depth=1.1, dish_invert=false,
1416+
stem_clips=false, stem_walls_inset=0, stem_walls_tolerance=0.25,
1417+
corner_radius=0.2, corner_radius_curve=17.9,
1418+
visualize_legends=false, legend_carved=false, legends=[""], legend_font_sizes=[6], legend_fonts=["Roboto"], legend_trans=[[0,0,0]], legend_trans2=[[0,0,0]], legend_rotation=[[0,0,0]], legend_rotation2=[[0,0,0]], legend_scale=[[0,0,0]], legend_underset=[[0,0,0]],
1419+
homing_dot_length=0, homing_dot_width=0, homing_dot_x=0, homing_dot_y=0, homing_dot_z=0, polygon_layers=10,
1420+
debug=false
1421+
) {
1422+
14141423
// NOTE: The 0-index values are ignored (there's no row 0 in XDA)
1415-
row_height = dish_invert ? 8.1+height_extra : 9.1+height_extra; // One less if we're generating a spacebar
1424+
row_height = dish_invert ? 8.95+height_extra : 9.95+height_extra; // One less if we're generating a spacebar
14161425
if (row < 1) {
14171426
warning("We only support rows 1 for XDA profile caps!");
14181427
}
@@ -1435,7 +1444,7 @@ module XDA_keycap(row=1, length=18.41, width=18.41, height_extra=0, wall_thickne
14351444
legend_rotation=legend_rotation, legend_rotation2=legend_rotation2,
14361445
legend_underset=legend_underset, legend_carved=legend_carved,
14371446
polygon_layers=polygon_layers, polygon_layer_rotation=0,
1438-
polygon_edges=4, polygon_curve=5,
1447+
polygon_edges=4, polygon_curve=3.5,
14391448
key_rotation=key_rotation,
14401449
homing_dot_length=homing_dot_length, homing_dot_width=homing_dot_width,
14411450
homing_dot_x=homing_dot_x, homing_dot_y=homing_dot_y, homing_dot_z=homing_dot_z,
@@ -1444,8 +1453,8 @@ module XDA_keycap(row=1, length=18.41, width=18.41, height_extra=0, wall_thickne
14441453
debug=debug);
14451454
}
14461455

1447-
module XDA_stem(stem_type="box_cherry", key_height=7.3914, key_length=18.41, key_width=18.41, height_extra=0, dish_depth=1, dish_fn=128, dish_corner_fn=64, dish_thickness=1.5, dish_invert=false, depth=4, top_difference=19.05/5, wall_thickness=1.5, wall_extra=0.65, wall_inset=0, wall_tolerance=0.25, corner_radius=0.3, key_corner_radius=0.3, top_x=0, top_y=0, outside_tolerance_x=0.2, outside_tolerance_y=0.2, inside_tolerance=0.25, inset=0, top_thickness=1, side_support_thickness=0, side_supports=[0,0,0,0], flat_support=false, locations=[[0,0,0]], key_rotation=[0,0,0], polygon_layers=10, polygon_layer_rotation=0, hollow=false, uniform_wall_thickness=true) {
1448-
row_height = dish_invert ? 8.1+height_extra : 9.1+height_extra; // One less if we're generating a spacebar
1456+
module XDA_stem(stem_type="box_cherry", key_height=9.95, key_length=17.9, key_width=17.9, height_extra=0, dish_depth=1, dish_fn=128, dish_corner_fn=64, dish_thickness=1.5, dish_invert=false, depth=4, top_difference=3.6, wall_thickness=1.5, wall_extra=0.65, wall_inset=0, wall_tolerance=0.25, corner_radius=0.3, key_corner_radius=0.3, top_x=0, top_y=0, outside_tolerance_x=0.2, outside_tolerance_y=0.2, inside_tolerance=0.25, inset=0, top_thickness=1, side_support_thickness=0, side_supports=[0,0,0,0], flat_support=false, locations=[[0,0,0]], key_rotation=[0,0,0], polygon_layers=10, polygon_layer_rotation=0, hollow=false, uniform_wall_thickness=true) {
1457+
row_height = dish_invert ? 8.95+height_extra : 9.95+height_extra; // One less if we're generating a spacebar
14491458
dish_type = "sphere";
14501459
dish_z = 0.111; // NOTE: Width of the top dish (at widest) should be ~12.7mm
14511460
corner_radius_curve = 8;

0 commit comments

Comments
 (0)