mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2024-11-30 00:16:10 +00:00
Merge branch 'master' into flat-sided-keycaps
This commit is contained in:
commit
842866e427
27
README.md
27
README.md
@ -7,22 +7,13 @@ This library is a keycap and keyset construction library for mechanical keyboard
|
|||||||
Relevant links:
|
Relevant links:
|
||||||
* Thingiverse: https://www.thingiverse.com/thing:2783650
|
* Thingiverse: https://www.thingiverse.com/thing:2783650
|
||||||
* Shapeways: https://www.shapeways.com/designer/rsheldiii/creations
|
* Shapeways: https://www.shapeways.com/designer/rsheldiii/creations
|
||||||
|
* Buy me a coffee: https://ko-fi.com/rsheldiii, but only if you want to!
|
||||||
|
|
||||||
## How to run
|
## How to run
|
||||||
|
|
||||||
#### Thingiverse Customizer
|
#### OpenSCAD Proper (recommended way)
|
||||||
|
|
||||||
The easiest (though not the best) way to run this program is to boot it up in [Thingiverse's Customizer](https://www.thingiverse.com/apps/customizer/run?thing_id=2783650). Explanations of each option are provided, as well as some default variables. Twiddle the variables to see how the keycap changes!
|
If you are technically inclined at all, this is definitely the best way to run the code. It's not very hard!
|
||||||
|
|
||||||
The customizer is not always kept up to date, so I recommend the options below.
|
|
||||||
|
|
||||||
#### OpenSCAD Customizer
|
|
||||||
|
|
||||||
If you find that the Thingiverse Customizer is timing out, but you're not technically inclined enough to start programming in OpenSCAD, you can look into [getting OpenSCAD's customizer working](https://github.com/rsheldiii/KeyV2/wiki/Getting-the-OpenSCAD-Customizer-working).
|
|
||||||
|
|
||||||
#### OpenSCAD Proper
|
|
||||||
|
|
||||||
If you are technically inclined at all, this is definitely the recommended way to run the code. It's not very hard!
|
|
||||||
|
|
||||||
First, you'll need OpenSCAD: http://www.openscad.org/downloads.html. I highly recommend installing the development snapshot, as they generally support more features and are relatively stable. Development snapshots are listed in their own section on the downloads page.
|
First, you'll need OpenSCAD: http://www.openscad.org/downloads.html. I highly recommend installing the development snapshot, as they generally support more features and are relatively stable. Development snapshots are listed in their own section on the downloads page.
|
||||||
|
|
||||||
@ -30,6 +21,18 @@ After you have openSCAD installed, you need to download the code and run it. run
|
|||||||
|
|
||||||
All examples below assume you are running the library on your computer with OpenSCAD.
|
All examples below assume you are running the library on your computer with OpenSCAD.
|
||||||
|
|
||||||
|
#### OpenSCAD Customizer
|
||||||
|
|
||||||
|
If you're not technically inclined enough to start programming in OpenSCAD (it's easier than you think), you can look into [getting OpenSCAD's customizer working](https://github.com/rsheldiii/KeyV2/wiki/Getting-the-OpenSCAD-Customizer-working).
|
||||||
|
|
||||||
|
`customizer.scad` is auto-generated from the other files in this repository due to a quirk with how OpenSCAD shows customizer settings. It should be perpetually kept up to date, but there may be some bugs. feel free to open an issue if you find one!
|
||||||
|
|
||||||
|
#### Thingiverse Customizer
|
||||||
|
|
||||||
|
The easiest and buggiest way to run this program is to boot it up in [Thingiverse's Customizer](https://www.thingiverse.com/apps/customizer/run?thing_id=2783650). Explanations of each option are provided, as well as some default variables. Twiddle the variables to see how the keycap changes!
|
||||||
|
|
||||||
|
Unfortunately I don't think I can update the Thingiverse customizer without breaking it, so you don't get all the cool new features I've been developing over the past couple years.
|
||||||
|
|
||||||
## High-level overview
|
## High-level overview
|
||||||
|
|
||||||
This library supports Cherry and Alps switches, and has pre-defined key profiles for SA, DSA, DCS, G20, Hi-Pro and (some form of) OEM keycaps. `keys.scad` is the entry point for everything but the most technical use. Pre-programmed key profiles can be found in the `key_profiles` directory.
|
This library supports Cherry and Alps switches, and has pre-defined key profiles for SA, DSA, DCS, G20, Hi-Pro and (some form of) OEM keycaps. `keys.scad` is the entry point for everything but the most technical use. Pre-programmed key profiles can be found in the `key_profiles` directory.
|
||||||
|
960
customizer.scad
960
customizer.scad
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,8 @@ row = 1; // [5,1,2,3,4,0]
|
|||||||
// What does the top of your key say?
|
// What does the top of your key say?
|
||||||
legend = "";
|
legend = "";
|
||||||
|
|
||||||
|
$using_customizer = true;
|
||||||
|
|
||||||
include <src/settings.scad>
|
include <src/settings.scad>
|
||||||
|
|
||||||
include <src/key_sizes.scad>
|
include <src/key_sizes.scad>
|
||||||
@ -18,8 +20,7 @@ include <src/key_profiles.scad>
|
|||||||
include <src/key_types.scad>
|
include <src/key_types.scad>
|
||||||
include <src/key_transformations.scad>
|
include <src/key_transformations.scad>
|
||||||
include <src/key_helpers.scad>
|
include <src/key_helpers.scad>
|
||||||
|
include <src/key.scad>
|
||||||
use <src/key.scad>
|
|
||||||
|
|
||||||
key_profile(key_profile, row) legend(legend) {
|
key_profile(key_profile, row) legend(legend) {
|
||||||
key();
|
key();
|
||||||
|
@ -5,12 +5,10 @@ module OpenSCAD
|
|||||||
|
|
||||||
Dir.chdir File.dirname(filename)
|
Dir.chdir File.dirname(filename)
|
||||||
lines = lines.flat_map do |line|
|
lines = lines.flat_map do |line|
|
||||||
|
# please note we do not implement `use` at all
|
||||||
if line =~ /(include|use)\s*<(.*)>/
|
if line =~ /(include|use)\s*<(.*)>/
|
||||||
# File.readlines("./#{$2}")
|
# File.readlines("./#{$2}")
|
||||||
expand("./#{$2}")
|
expand("./#{$2}")
|
||||||
# in lieu of actually implementing `use`, we can just cull this final line from key.scad
|
|
||||||
elsif line =~ /example\_key\(\);/
|
|
||||||
""
|
|
||||||
else
|
else
|
||||||
line
|
line
|
||||||
end
|
end
|
||||||
|
@ -336,7 +336,7 @@ module legends(depth=0) {
|
|||||||
for (i=[0:len($front_legends)-1]) {
|
for (i=[0:len($front_legends)-1]) {
|
||||||
rotate([90,0,0]) keytext($front_legends[i][0], $front_legends[i][1], $front_legends[i][2], depth);
|
rotate([90,0,0]) keytext($front_legends[i][0], $front_legends[i][1], $front_legends[i][2], depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (len($legends) > 0) {
|
if (len($legends) > 0) {
|
||||||
@ -430,4 +430,6 @@ module example_key(){
|
|||||||
key();
|
key();
|
||||||
}
|
}
|
||||||
|
|
||||||
example_key();
|
if (!$using_customizer) {
|
||||||
|
example_key();
|
||||||
|
}
|
||||||
|
@ -72,66 +72,3 @@ function profile_segment_length(profile,i) = norm(profile[(i+1)%len(profile)] -
|
|||||||
|
|
||||||
// Generates an array with n copies of value (default 0)
|
// Generates an array with n copies of value (default 0)
|
||||||
function dup(value=0,n) = [for (i = [1:n]) value];
|
function dup(value=0,n) = [for (i = [1:n]) value];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use <scad-utils/transformations.scad>
|
|
||||||
use <scad-utils/trajectory_path.scad>
|
|
||||||
use <scad-utils/trajectory.scad>
|
|
||||||
use <scad-utils/shapes.scad>
|
|
||||||
|
|
||||||
module fakeISOEnter(thickness_difference = 0){
|
|
||||||
// 1u is the space taken upy by a 1u keycap.
|
|
||||||
// unit is the space taken up by a unit space for a keycap.
|
|
||||||
// formula is 1u + unit *(length - 1)
|
|
||||||
|
|
||||||
// t is all modifications to the polygon array
|
|
||||||
t = thickness_difference/2 - (19.02 - 18.16);
|
|
||||||
|
|
||||||
function unit(length) = 19.02 * length;
|
|
||||||
|
|
||||||
pointArray = [
|
|
||||||
[19.05 * (-.5) + t, 19.05 * (-1) + t],
|
|
||||||
[19.05 * (0.5) - t, 19.05 * (-1) + t],
|
|
||||||
[19.05 * (0.5) - t, 19.05 * (1) - t],
|
|
||||||
[19.05 * (-0.75) + t, 19.05 * (1) - t],
|
|
||||||
[19.05 * (-0.75) + t, 19.05 * (0) + t],
|
|
||||||
[19.05 * (-0.5) + t, 19.05 * (0) + t]
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/*translate([unit(-.5), unit(-1) + 0.86]){*/
|
|
||||||
minkowski() {
|
|
||||||
circle($corner_radius, $fn=20);
|
|
||||||
offset(r=-$corner_radius * 2, $fn=20) polygon(points=pointArray);
|
|
||||||
}
|
|
||||||
/*}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
function isoEnter() = [
|
|
||||||
[19.05 * (-.5) + (19.02 - 18.16), 19.05 * (-1) + (19.02 - 18.16)],
|
|
||||||
[19.05 * (0.5) - (19.02 - 18.16), 19.05 * (-1) + (19.02 - 18.16)],
|
|
||||||
[19.05 * (0.5) - (19.02 - 18.16), 19.05 * (1) - (19.02 - 18.16)],
|
|
||||||
[19.05 * (-0.75) + (19.02 - 18.16), 19.05 * (1) - (19.02 - 18.16)],
|
|
||||||
[19.05 * (-0.75) + (19.02 - 18.16), 19.05 * (0) + (19.02 - 18.16)],
|
|
||||||
[19.05 * (-0.5) + (19.02 - 18.16), 19.05 * (0) + (19.02 - 18.16)]
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
path_definition = [
|
|
||||||
trajectory(forward = 10, roll = 0),
|
|
||||||
];
|
|
||||||
|
|
||||||
// sweep
|
|
||||||
path = quantize_trajectories(path_definition, steps=100);
|
|
||||||
|
|
||||||
// skin
|
|
||||||
myLen = len(path)-1;
|
|
||||||
trans = [ for (i=[0:len(path)-1]) transform(path[i], isoEnter()) ];
|
|
||||||
|
|
||||||
translate([0,10,0])
|
|
||||||
skin(trans);
|
|
||||||
|
@ -18,8 +18,6 @@ $font_size = 6;
|
|||||||
// Set this to true if you're making a spacebar!
|
// Set this to true if you're making a spacebar!
|
||||||
$inverted_dish = false;
|
$inverted_dish = false;
|
||||||
|
|
||||||
// set this to true if you are making double sculpted keycaps
|
|
||||||
$double_sculpted = false;
|
|
||||||
// change aggressiveness of double sculpting
|
// change aggressiveness of double sculpting
|
||||||
// this is the radius of the cylinder the keytops are placed on
|
// this is the radius of the cylinder the keytops are placed on
|
||||||
$double_sculpt_radius = 200;
|
$double_sculpt_radius = 200;
|
||||||
@ -31,13 +29,11 @@ $support_type = "flared"; // [flared, bars, flat, disable]
|
|||||||
// Supports for the stem, as it often comes off during printing. Reccommended for most machines
|
// Supports for the stem, as it often comes off during printing. Reccommended for most machines
|
||||||
$stem_support_type = "tines"; // [tines, brim, disabled]
|
$stem_support_type = "tines"; // [tines, brim, disabled]
|
||||||
|
|
||||||
// enable to have stem support extend past the keycap bottom, to (hopefully) the next
|
// make legends outset instead of inset.
|
||||||
// keycap. only works on tines right now
|
// broken off from artisan support since who wants outset legends?
|
||||||
$extra_long_stem_support = false;
|
$outset_legends = false;
|
||||||
|
|
||||||
/* [Advanced] */
|
/* [Key] */
|
||||||
|
|
||||||
/* Key */
|
|
||||||
// Height in units of key. should remain 1 for most uses
|
// Height in units of key. should remain 1 for most uses
|
||||||
$key_height = 1.0;
|
$key_height = 1.0;
|
||||||
// Keytop thickness, aka how many millimeters between the inside and outside of the top surface of the key
|
// Keytop thickness, aka how many millimeters between the inside and outside of the top surface of the key
|
||||||
@ -68,7 +64,7 @@ $top_skew = 1.7;
|
|||||||
// for double axis sculpted keycaps and probably not much else
|
// for double axis sculpted keycaps and probably not much else
|
||||||
$top_skew_x = 0;
|
$top_skew_x = 0;
|
||||||
|
|
||||||
/* Stem */
|
/* [Stem] */
|
||||||
|
|
||||||
// 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
|
// 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
|
||||||
$stem_throw = 4;
|
$stem_throw = 4;
|
||||||
@ -82,7 +78,11 @@ $stem_inset = 0;
|
|||||||
// How many degrees to rotate the stems. useful for sideways keycaps, maybe
|
// How many degrees to rotate the stems. useful for sideways keycaps, maybe
|
||||||
$stem_rotation = 0;
|
$stem_rotation = 0;
|
||||||
|
|
||||||
/* Shape */
|
// enable to have stem support extend past the keycap bottom, to (hopefully) the next
|
||||||
|
// keycap. only works on tines right now
|
||||||
|
$extra_long_stem_support = false;
|
||||||
|
|
||||||
|
/* [Shape] */
|
||||||
|
|
||||||
// Key shape type, determines the shape of the key. default is 'rounded square'
|
// Key shape type, determines the shape of the key. default is 'rounded square'
|
||||||
$key_shape_type = "rounded_square";
|
$key_shape_type = "rounded_square";
|
||||||
@ -92,7 +92,7 @@ $linear_extrude_height_adjustment = 0;
|
|||||||
// If you're doing fancy bowed keycap sides, this controls how many slices you take
|
// If you're doing fancy bowed keycap sides, this controls how many slices you take
|
||||||
$height_slices = 1;
|
$height_slices = 1;
|
||||||
|
|
||||||
/* Dish */
|
/* [Dish] */
|
||||||
|
|
||||||
// What type of dish the key has. note that unlike stems and supports a dish ALWAYS gets rendered.
|
// What type of dish the key has. note that unlike stems and supports a dish ALWAYS gets rendered.
|
||||||
$dish_type = "cylindrical"; // [cylindrical, spherical, sideways cylindrical, old spherical, disable]
|
$dish_type = "cylindrical"; // [cylindrical, spherical, sideways cylindrical, old spherical, disable]
|
||||||
@ -107,7 +107,7 @@ $dish_overdraw_width = 0;
|
|||||||
// Same as width but for height
|
// Same as width but for height
|
||||||
$dish_overdraw_height = 0;
|
$dish_overdraw_height = 0;
|
||||||
|
|
||||||
/* Misc */
|
/* [Misc] */
|
||||||
// There's a bevel on the cherry stems to aid insertion / guard against first layer squishing making a hard-to-fit stem.
|
// There's a bevel on the cherry stems to aid insertion / guard against first layer squishing making a hard-to-fit stem.
|
||||||
$cherry_bevel = true;
|
$cherry_bevel = true;
|
||||||
|
|
||||||
@ -117,19 +117,19 @@ $stem_support_height = .8;
|
|||||||
$font="DejaVu Sans Mono:style=Book";
|
$font="DejaVu Sans Mono:style=Book";
|
||||||
// Whether or not to render fake keyswitches to check clearances
|
// Whether or not to render fake keyswitches to check clearances
|
||||||
$clearance_check = false;
|
$clearance_check = false;
|
||||||
// Use linear_extrude instead of hull slices to make the shape of the key
|
|
||||||
// Should be faster, also required for concave shapes
|
// Should be faster, also required for concave shapes
|
||||||
|
// Use linear_extrude instead of hull slices to make the shape of the key
|
||||||
$linear_extrude_shape = false;
|
$linear_extrude_shape = false;
|
||||||
|
|
||||||
// brand new, more correct, hopefully faster, lots more work
|
|
||||||
// warns in trajectory.scad but it looks benign
|
// warns in trajectory.scad but it looks benign
|
||||||
|
// brand new, more correct, hopefully faster, lots more work
|
||||||
$skin_extrude_shape = false;
|
$skin_extrude_shape = false;
|
||||||
//should the key be rounded? unnecessary for most printers, and very slow
|
// This doesn't work very well, but you can try
|
||||||
$rounded_key = false;
|
$rounded_key = false;
|
||||||
//minkowski radius. radius of sphere used in minkowski sum for minkowski_key function. 1.75 for G20
|
//minkowski radius. radius of sphere used in minkowski sum for minkowski_key function. 1.75 for G20
|
||||||
$minkowski_radius = .33;
|
$minkowski_radius = .33;
|
||||||
|
|
||||||
/* Features */
|
/* [Features] */
|
||||||
|
|
||||||
//insert locating bump
|
//insert locating bump
|
||||||
$key_bump = false;
|
$key_bump = false;
|
||||||
@ -140,6 +140,9 @@ $key_bump_edge = 0.4;
|
|||||||
|
|
||||||
/* [Hidden] */
|
/* [Hidden] */
|
||||||
|
|
||||||
|
// set this to true if you are making double sculpted keycaps
|
||||||
|
$double_sculpted = false;
|
||||||
|
|
||||||
//list of legends to place on a key format: [text, halign, valign, size]
|
//list of legends to place on a key format: [text, halign, valign, size]
|
||||||
//halign = "left" or "center" or "right"
|
//halign = "left" or "center" or "right"
|
||||||
//valign = "top" or "center" or "bottom"
|
//valign = "top" or "center" or "bottom"
|
||||||
@ -152,10 +155,6 @@ $legends = [];
|
|||||||
// Currently does not work with thingiverse customizer, and actually breaks it
|
// Currently does not work with thingiverse customizer, and actually breaks it
|
||||||
$front_legends = [];
|
$front_legends = [];
|
||||||
|
|
||||||
// make legends outset instead of inset.
|
|
||||||
// broken off from artisan support since who wants outset legends?
|
|
||||||
$outset_legends = false;
|
|
||||||
|
|
||||||
// print legends on the front of the key instead of the top
|
// print legends on the front of the key instead of the top
|
||||||
$front_print_legends = false;
|
$front_print_legends = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user