KeyV2/src/key_transformations.scad

128 lines
2.3 KiB
OpenSCAD
Raw Normal View History

// kind of a catch-all at this point for any directive that doesn't fit in the other files
2018-02-06 17:26:19 +11: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();
}
module brimmed_stem_support(height = 0.4) {
$stem_support_type = "brim";
$stem_support_height = height;
children();
}
module tined_stem_support(height = 0.4) {
$stem_support_type = "tines";
$stem_support_height = height;
children();
}
module rounded() {
$rounded_key = true;
children();
}
module inverted() {
$inverted_dish = true;
children();
}
module rotated() {
2018-06-05 11:13:09 +10:00
$stem_rotation = 90;
children();
}
module stabilized(mm=12, vertical = false, type=undef) {
if (vertical) {
$stabilizer_type = type ? type : $stabilizer_type ? $stabilizer_type : "costar_stabilizer";
2018-06-25 14:41:02 +10:00
$stabilizers = [
[0, mm],
[0, -mm]
];
children();
} else {
$stabilizer_type = type ? type : $stabilizer_type ? $stabilizer_type : "costar_stabilizer";
2018-06-25 14:41:02 +10:00
$stabilizers = [
[mm, 0],
[-mm, 0]
];
children();
}
}
module dishless() {
$dish_type = "disable";
children();
}
module inset(val=1) {
2018-06-05 11:13:09 +10:00
$stem_inset = val;
children();
}
module filled() {
2018-06-05 11:13:09 +10:00
$stem_type = "filled";
children();
}
module blank() {
$stem_type = "disable";
children();
}
2018-06-25 10:26:19 +10:00
module cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
2018-02-05 06:33:12 +11:00
$stem_type = "cherry";
children();
}
2018-06-25 10:26:19 +10:00
module alps(slop) {
$stem_slop = slop ? slop : $stem_slop;
2018-02-05 06:33:12 +11:00
$stem_type = "alps";
children();
}
2018-06-25 10:26:19 +10:00
module rounded_cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "rounded_cherry";
children();
}
module box_cherry(slop) {
$stem_slop = slop ? slop : $stem_slop;
$stem_type = "box_cherry";
children();
}
module flared_support() {
$support_type = "flared";
children();
}
module bar_support() {
$support_type = "bars";
children();
}
module flat_support() {
$support_type = "flat";
children();
}
2018-06-04 10:17:22 +10: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];
children();
}
module bump(depth=undef) {
$key_bump = true;
$key_bump_depth = depth == undef ? $key_bump_depth : depth;
children();
}