offset stems example

This commit is contained in:
Bob 2020-09-05 22:52:33 -04:00
parent d9c9cf776f
commit 45a99ccc56
2 changed files with 28 additions and 7 deletions

View File

@ -1,3 +1,4 @@
// the point of this file is to be a sort of DSL for constructing keycaps. // 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 // 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 // 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 // special variables, but that's a limitation of SCAD we have to work around
include <./includes.scad> include <./includes.scad>
include <src/libraries/round-anything/polyround.scad>
// example key // 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 // example row
/* for (x = [0:1:4]) {
translate_u(0,-x) dcs_row(x) key();
} */
// example layout // 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)); */

View File

@ -402,7 +402,7 @@ module key(inset = false) {
// both stem and support are optional // both stem and support are optional
if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) { if ($stem_type != "disable" || ($stabilizers != [] && $stabilizer_type != "disable")) {
dished($keytop_thickness, $inverted_dish) { 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 ($stabilizer_type != "disable") stems_for($stabilizers, $stabilizer_type);
if ($stem_type != "disable") stems_for($stem_positions, $stem_type); if ($stem_type != "disable") stems_for($stem_positions, $stem_type);
@ -412,7 +412,7 @@ module key(inset = false) {
if ($support_type != "disable"){ if ($support_type != "disable"){
inside() { 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); if ($stabilizer_type != "disable") support_for($stabilizers, $stabilizer_type);
// always render stem support even if there isn't a stem. // always render stem support even if there isn't a stem.