mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2024-11-25 22:35:35 +00:00
Merge pull request #27 from ihatemyisp/dual_legend
Dual legends and Dactyl Manuform
This commit is contained in:
commit
19abd521f2
BIN
assets/dual_legends.png
Normal file
BIN
assets/dual_legends.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
@ -3,4 +3,4 @@ include <../includes.scad>
|
||||
// plates are currently generated via the same layout arrays as layouts are.
|
||||
// just pass the layout to plate() and it'll do it's job using hull().
|
||||
// still in beta
|
||||
plate(60_percent_default_layout);
|
||||
plate(60_percent_default_layout);
|
0
gulpfile.js
Executable file → Normal file
0
gulpfile.js
Executable file → Normal file
@ -17,4 +17,4 @@ dcs_row(5) legend("⇪", size=9) key();
|
||||
} */
|
||||
|
||||
// example layout
|
||||
/* preonic_default("dcs"); */
|
||||
/* preonic_default("dcs"); */
|
16
src/key.scad
16
src/key.scad
@ -328,15 +328,17 @@ module clearance_check() {
|
||||
}
|
||||
|
||||
module legends(depth=0) {
|
||||
if ($front_print_legends) {
|
||||
|
||||
if (len($front_legends) > 0) {
|
||||
front_placement() {
|
||||
if (len($legends) > 0) {
|
||||
for (i=[0:len($legends)-1]) {
|
||||
rotate([90,0,0]) keytext($legends[i][0], $legends[i][1], $legends[i][2], depth);
|
||||
}
|
||||
}
|
||||
if (len($front_legends) > 0) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if (len($legends) > 0) {
|
||||
top_of_key() {
|
||||
// outset legend
|
||||
if (len($legends) > 0) {
|
||||
|
@ -14,4 +14,7 @@ include <layouts/60_percent/default.scad>
|
||||
include <layouts/gherkin/default.scad>
|
||||
include <layouts/gherkin/gherkin_bump.scad>
|
||||
|
||||
include <layouts/dactyl_manuform/4x6.scad>
|
||||
include <layouts/dactyl_manuform/4x6_legends.scad>
|
||||
|
||||
include <layouts/plate.scad>
|
||||
|
@ -131,6 +131,12 @@ module legend(text, position=[0,0], size=undef) {
|
||||
children();
|
||||
}
|
||||
|
||||
module front_legend(text, position=[0,0], size=undef) {
|
||||
font_size = size == undef ? $font_size : size;
|
||||
$front_legends = [for(L=[$front_legends, [[text, position, font_size]]], a=L) a];
|
||||
children();
|
||||
}
|
||||
|
||||
module bump(depth=undef) {
|
||||
$key_bump = true;
|
||||
$key_bump_depth = depth == undef ? $key_bump_depth : depth;
|
||||
|
26
src/layouts/dactyl_manuform/4x6.scad
Normal file
26
src/layouts/dactyl_manuform/4x6.scad
Normal file
@ -0,0 +1,26 @@
|
||||
include <../layout.scad>
|
||||
|
||||
dactyl_manuform_4x6_main = [
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[-1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_l = [
|
||||
[1.25, 1.25],
|
||||
[-0.25, 1, 1],
|
||||
[-0.25, 1, 1]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_r = [
|
||||
[1.25, 1.25],
|
||||
[-0.25, 1, 1],
|
||||
[-0.25, 1, 1]
|
||||
];
|
||||
|
||||
module dactyl_manuform_4x6(profile) {
|
||||
layout(dactyl_manuform_4x6_main, profile) children();
|
||||
translate_u(3,-5) rotate([0,0,25])layout(dactyl_manuform_4x6_thumbs_l, profile, row_override=3) children();
|
||||
translate_u(7.75,-3.95) rotate([0,0,-25])layout(dactyl_manuform_4x6_thumbs_r, profile, row_override=3) children();
|
||||
}
|
64
src/layouts/dactyl_manuform/4x6_legends.scad
Normal file
64
src/layouts/dactyl_manuform/4x6_legends.scad
Normal file
@ -0,0 +1,64 @@
|
||||
include <../layout.scad>
|
||||
|
||||
dactyl_manuform_4x6_main = [
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
|
||||
[-1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_l = [
|
||||
[1.25, 1.25],
|
||||
[-0.25, 1, 1],
|
||||
[-0.25, 1, 1]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_r = [
|
||||
[1.25, 1.25],
|
||||
[-0.25, 1, 1],
|
||||
[-0.25, 1, 1]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_main_legends = [
|
||||
["ESC", "Q", "W", "E", "R", "T", "", "Y", "U", "I", "O", "P", "{["],
|
||||
["LS", "A", "S", "D", "F", "G", "", "H", "J", "K", "L", ";:", "'\""],
|
||||
["TAB", "Z", "X", "C", "V", "B", "", "N", "M", ",<", ".>", "/?", "\\|"],
|
||||
["", "", "CAPS", "T(1)", "", "", "", "", "", "T(2)", "]}", "", ""]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_main_front_legends = [
|
||||
["F1", "F2", "F3", "F4", "F5", "F6", "", "F7", "F8", "F9", "F10", "F11", "F12"],
|
||||
["", "", "", "", "", "PGUP", "", "", "UP", "", "", "", ""],
|
||||
["", "", "", "", "", "PGDN", "", "LFT", "DWN", "RHT", "", "", ""],
|
||||
["", "", "", "T(0)", "", "", "", "", "", "T(2)", "", "", ""]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_l_legends = [
|
||||
["~`", "LCTL"],
|
||||
["", "RALT", "LCMD"],
|
||||
["", "MEH", "T(2)"]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_l_front_legends = [
|
||||
["", ""],
|
||||
["", "PSC", "LCMD"],
|
||||
["", "", "TEMP"]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_r_legends = [
|
||||
["", "BKSP"],
|
||||
["", "ENTR", "CP"],
|
||||
["", "T(1)", "PST"]
|
||||
];
|
||||
|
||||
dactyl_manuform_4x6_thumbs_r_front_legends = [
|
||||
["", ""],
|
||||
["", "", ""],
|
||||
["", "TEMP", ""]
|
||||
];
|
||||
|
||||
module dactyl_manuform_4x6_legends(profile, row_sculpting_offset=1, column_override=undef) {
|
||||
layout(dactyl_manuform_4x6_main, profile, legends=dactyl_manuform_4x6_main_legends, front_legends=dactyl_manuform_4x6_main_front_legends, row_sculpting_offset=row_sculpting_offset, column_override=column_override, column_sculpt_profile="cresting_wave") children();
|
||||
translate_u(3,-5) rotate([0,0,25]) layout(dactyl_manuform_4x6_thumbs_l, profile, legends=dactyl_manuform_4x6_thumbs_l_legends, front_legends=dactyl_manuform_4x6_thumbs_l_front_legends, row_sculpting_offset=row_sculpting_offset, column_override=column_override, column_sculpt_profile="cresting_wave") children();
|
||||
translate_u(7.75,-3.95) rotate([0,0,-25]) layout(dactyl_manuform_4x6_thumbs_r, profile, legends=dactyl_manuform_4x6_thumbs_r_legends, front_legends=dactyl_manuform_4x6_thumbs_r_front_legends, row_sculpting_offset=row_sculpting_offset, column_override=column_override, column_sculpt_profile="cresting_wave") children();
|
||||
}
|
@ -20,7 +20,7 @@ function double_sculpted_column(column, row_length, column_sculpt_profile) =
|
||||
1hand(column, row_length) : (column_sculpt_profile == "cresting_wave") ?
|
||||
cresting_wave(column, row_length) : 0;
|
||||
|
||||
module layout(list, profile="dcs", legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) {
|
||||
module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) {
|
||||
for (row = [0:len(list)-1]){
|
||||
/* echo("**ROW**:", row); */
|
||||
row_length = len(list[row]);
|
||||
@ -36,9 +36,10 @@ module layout(list, profile="dcs", legends=undef, row_sculpting_offset=0, row_ov
|
||||
// supports negative values for nonexistent keys
|
||||
if (key_length >= 1) {
|
||||
translate_u(column_distance - (key_length/2), -row) {
|
||||
key_profile(profile, row_sculpting, column_value) u(key_length) legend(legends ? legends[row][column] : "") cherry() { // (row+4) % 5 + 1
|
||||
$row = row;
|
||||
$column = column;
|
||||
|
||||
key_profile(profile, row_sculpting, column_value) u(key_length) legend(legends ? legends[row][column] : "") front_legend(front_legends ? front_legends[row][column] : "") cherry() { // (row+4) % 5 + 1
|
||||
$row = row;
|
||||
$column = column;
|
||||
|
||||
if (key_length == 6.25) {
|
||||
spacebar() {
|
||||
|
@ -19,13 +19,11 @@ module switch_hole() {
|
||||
cube(14, center=true);
|
||||
}
|
||||
|
||||
|
||||
module plate(layout_object) {
|
||||
difference() {
|
||||
hull() {
|
||||
simple_layout(layout_object) unit_corners();
|
||||
}
|
||||
|
||||
simple_layout(layout_object) switch_hole();
|
||||
}
|
||||
}
|
||||
}
|
@ -146,6 +146,12 @@ $key_bump_edge = 0.4;
|
||||
// Currently does not work with thingiverse customizer, and actually breaks it
|
||||
$legends = [];
|
||||
|
||||
//list of front legends to place on a key format: [text, halign, valign, size]
|
||||
//halign = "left" or "center" or "right"
|
||||
//valign = "top" or "center" or "bottom"
|
||||
// Currently does not work with thingiverse customizer, and actually breaks it
|
||||
$front_legends = [];
|
||||
|
||||
// make legends outset instead of inset.
|
||||
// broken off from artisan support since who wants outset legends?
|
||||
$outset_legends = false;
|
||||
|
Loading…
Reference in New Issue
Block a user