mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2024-11-29 08:03:02 +00:00
offset stems example
This commit is contained in:
parent
d9c9cf776f
commit
45a99ccc56
31
keys.scad
31
keys.scad
@ -1,3 +1,4 @@
|
||||
|
||||
// the point of this file is to be a sort of DSL for constructing keycaps.
|
||||
// when you create a method chain you are just changing the parameters
|
||||
// key.scad uses, it doesn't generate anything itself until the end. This
|
||||
@ -6,15 +7,35 @@
|
||||
// special variables, but that's a limitation of SCAD we have to work around
|
||||
|
||||
include <./includes.scad>
|
||||
include <src/libraries/round-anything/polyround.scad>
|
||||
|
||||
|
||||
// example key
|
||||
dcs_row(5) legend("⇪", size=9) key();
|
||||
/* $stem_throw = 1; */
|
||||
/* $stem_type = "custom"; */
|
||||
$outset_legends = true;
|
||||
/* $hull_shape_type = "linear extrude"; */
|
||||
|
||||
/* dcs_row(5) iso_enter() front_legend("j") key(); */
|
||||
$stabilizer_type = "cherry_stabilizer";
|
||||
$stem_support_type = "disabled";
|
||||
/* $stem_rotation=90; */
|
||||
|
||||
/* $skin_extrude_shape = true; */
|
||||
|
||||
|
||||
dcs_row(1) spacebar() uh(1.5){
|
||||
/* $top_tilt = -6; */
|
||||
key();
|
||||
}
|
||||
|
||||
/* $rounded_key = true; */
|
||||
|
||||
/* sa_row(1) key(); */
|
||||
// example row
|
||||
/* for (x = [0:1:4]) {
|
||||
translate_u(0,-x) dcs_row(x) key();
|
||||
} */
|
||||
|
||||
// example layout
|
||||
/* preonic_default("dcs"); */
|
||||
|
||||
|
||||
/* %side_rounded_square([10,10], 0.5); */
|
||||
/* translate([00,0,0]) polygon(new_side_rounded_square([10,10], 0.5)); */
|
||||
|
@ -402,7 +402,7 @@ module key(inset = false) {
|
||||
// both stem and support are optional
|
||||
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
|
||||
dished($keytop_thickness, $inverted_dish) {
|
||||
translate([0, 0, $stem_inset]) {
|
||||
translate([0, (unit_length($key_height) - unit_length(1))/2, $stem_inset]) {
|
||||
if ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
|
||||
|
||||
if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
|
||||
@ -412,7 +412,7 @@ module key(inset = false) {
|
||||
|
||||
if ($support_type != "disable"){
|
||||
inside() {
|
||||
translate([0, 0, $stem_inset]) {
|
||||
translate([0, (unit_length($key_height) - unit_length(1))/2, $stem_inset]) {
|
||||
if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type);
|
||||
|
||||
// always render stem support even if there isn't a stem.
|
||||
|
Loading…
Reference in New Issue
Block a user