2017-12-20 05:47:03 +00:00
|
|
|
// kind of a catch-all at this point for any directive that doesn't fit in the other files
|
|
|
|
|
2018-02-06 06:26:19 +00:00
|
|
|
//TODO duplicate def to not make this a special var. maybe not worth it
|
|
|
|
unit = 19.05;
|
|
|
|
|
|
|
|
module translate_u(x=0, y=0, z=0){
|
|
|
|
translate([x * unit, y*unit, z*unit]) children();
|
|
|
|
}
|
|
|
|
|
2018-02-25 03:02:46 +00:00
|
|
|
module brimmed(height = 0.2) {
|
2017-12-20 05:47:03 +00:00
|
|
|
$has_brim = true;
|
2018-02-25 03:02:46 +00:00
|
|
|
$brim_height = height;
|
2017-12-20 05:47:03 +00:00
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module rounded() {
|
|
|
|
$rounded_key = true;
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module inverted() {
|
|
|
|
$inverted_dish = true;
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module rotated() {
|
2018-06-05 01:13:09 +00:00
|
|
|
$stem_rotation = 90;
|
|
|
|
children();
|
2017-12-20 05:47:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module stabilized(mm=12, vertical = false) {
|
|
|
|
if (vertical) {
|
|
|
|
$connectors = [
|
|
|
|
[0, 0],
|
|
|
|
[0, mm],
|
|
|
|
[0, -mm]
|
|
|
|
];
|
|
|
|
|
|
|
|
children();
|
|
|
|
} else {
|
|
|
|
$connectors = [
|
|
|
|
[0, 0],
|
|
|
|
[mm, 0],
|
|
|
|
[-mm, 0]
|
|
|
|
];
|
|
|
|
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module dishless() {
|
|
|
|
$dish_type = "no dish";
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module inset(val=1) {
|
2018-06-05 01:13:09 +00:00
|
|
|
$stem_inset = val;
|
|
|
|
children();
|
2017-12-20 05:47:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module filled() {
|
2018-06-05 01:13:09 +00:00
|
|
|
$stem_type = "filled";
|
|
|
|
children();
|
2017-12-20 05:47:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module blank() {
|
2018-02-04 19:33:12 +00:00
|
|
|
$stem_type = "blank";
|
2017-12-20 05:47:03 +00:00
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:26:19 +00:00
|
|
|
module cherry(slop) {
|
|
|
|
$stem_slop = slop ? slop : $stem_slop;
|
2018-02-04 19:33:12 +00:00
|
|
|
$stem_type = "cherry";
|
2017-12-20 05:47:03 +00:00
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:26:19 +00:00
|
|
|
module alps(slop) {
|
|
|
|
$stem_slop = slop ? slop : $stem_slop;
|
2018-02-04 19:33:12 +00:00
|
|
|
$stem_type = "alps";
|
2017-12-20 05:47:03 +00:00
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:26:19 +00:00
|
|
|
module rounded_cherry(slop) {
|
|
|
|
$stem_slop = slop ? slop : $stem_slop;
|
2018-02-04 19:33:12 +00:00
|
|
|
$stem_type = "cherry_rounded";
|
2017-12-20 05:47:03 +00:00
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module flared_support() {
|
|
|
|
$support_type = "flared";
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module bar_support() {
|
|
|
|
$support_type = "bars";
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
|
|
|
|
module flat_support() {
|
|
|
|
$support_type = "flat";
|
|
|
|
children();
|
|
|
|
}
|
2018-02-25 05:21:42 +00:00
|
|
|
|
2018-06-04 00:17:22 +00:00
|
|
|
module legend(text, position=[0,0], size=undef) {
|
|
|
|
font_size = size == undef ? $font_size : size;
|
|
|
|
$legends = [for(L=[$legends, [[text, position, font_size]]], a=L) a];
|
2018-02-25 05:21:42 +00:00
|
|
|
children();
|
|
|
|
}
|
2018-02-26 03:26:27 +00:00
|
|
|
|
|
|
|
module bump(depth=undef) {
|
|
|
|
$key_bump = true;
|
|
|
|
$key_bump_depth = depth == undef ? $key_bump_depth : depth;
|
|
|
|
children();
|
|
|
|
}
|