cyclone-pcb-factory/Hardware/Development/libs/micro_switch.scad

40 lines
1.1 KiB
OpenSCAD
Raw Normal View History

2013-10-15 23:05:26 +07:00
include <MCAD/materials.scad>
include <MCAD/metric_fastners.scad>
2013-10-14 23:03:15 +07:00
2013-10-19 21:34:31 +07:00
module micro_switch(with_extra_parts=false, exploded=false) {
scale([-1,1,1]) translate([-19.8, 0, 0]){
difference() {
color(BlackPaint) cube([19.8, 10.8, 6.4]);
2013-10-14 23:03:15 +07:00
2013-10-19 21:34:31 +07:00
translate([5.15, 2, 0]) {
translate([0, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
translate([9.5, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
}
2013-10-14 23:03:15 +07:00
}
2013-10-19 21:34:31 +07:00
translate([2.8, 10.8, 1.2])
rotate([0,0,10])
color(Steel) cube([17,1,4]);
2013-10-15 23:05:26 +07:00
2013-10-20 22:20:25 +07:00
if(with_extra_parts)
micro_switch_extras(exploded_distance=(exploded?15:0));
2013-10-15 23:05:26 +07:00
}
2013-10-14 23:03:15 +07:00
2013-10-20 22:20:25 +07:00
module micro_switch_extras(exploded_distance=0) {
screw_size = 2.2;
screw_length = 13;
echo("Non-Plastic Parts, 2, Self Tapping Screw 2.2 x 13 mm for micro switch");
2013-10-20 22:20:25 +07:00
translate([5.15, 2, 0]) color(Steel) {
translate([0, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(screw_size, screw_length);
translate([9.5, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(screw_size, screw_length);
}
2013-10-19 21:34:31 +07:00
}
2013-10-20 22:20:25 +07:00
2013-10-19 21:34:31 +07:00
}
2013-10-14 23:03:15 +07:00
micro_switch();