include include include wall = 1.32; e = 0.01; // added to prevent coplanar difference function inch(i) = i * 25.4; // Base block block_w = inch(1.75); block_d = inch(0.25); block_h = inch(1.125); module mount_block() { w = block_w; d = block_d; h = block_h; big_tab_d = d; difference() { linear_extrude(height=d) polygon(points=[[0,0],[w,0],[w,h],[w-inch(0.25),h],[0,inch(0.25)]]); // center screw hole *translate([w-inch(0.7),inch(0.5),-e]) cylinder_poly(r=N_clear(6)/2,h=h+2*2); } // bottom tab with hole translate([inch(0.5),-big_tab_d,0]) { difference() { cube([inch(0.78),big_tab_d,d]); translate([inch(3/8),big_tab_d/2,-e]) cylinder_poly(r=N_clear(6)/2,h=h+2*e); } } // right tab translate([w,h-inch(0.25)-inch(0.24),0]) cube([d,inch(0.25),d]); } module block_w_servo(servo_mount_o) { screw_block_d = 2.5; servo_inset_h = 1.5; difference() { union() { translate([servo_mount_o-servo_width/2-wall,0,0]) { // Servo support block difference() { union() { translate([-(servo_mount_o-servo_width/2-wall),0,0]) mount_block(); cube([servo_width+2*wall,servo_depth+2*servo_ear_depth,block_d]); } translate([wall,servo_ear_depth,block_d-servo_inset_h]) cube([servo_width, servo_depth, servo_inset_h+e]); } // bottom block to screw the servo into translate([wall,0,block_d]) difference() { translate([-screw_block_d,0,0]) cube_fillet([servo_width+2*screw_block_d,servo_ear_depth,screw_block_d], top=[0,screw_block_d,0,screw_block_d], $fn=4); translate([servo_width/2,servo_ear_depth/2,e]) cylinder_poly(r=1, h=screw_block_d); } // top block to screw the servo into translate([0,servo_depth+servo_ear_depth,block_d]) difference() { cube_fillet([servo_width+2*wall,servo_ear_depth,screw_block_d], top=[0,screw_block_d,0,screw_block_d], $fn=4); translate([servo_width/2+wall,servo_ear_depth/2,e]) cylinder_poly(r=1, h=screw_block_d); } } } // servo passthrough hole translate([servo_mount_o,servo_ear_depth+servo_depth-servo_big_tip_r,-e]) { cylinder_poly(h=block_d+2*e, r=servo_big_tip_r); translate([0,-servo_big_tip_r,0]) cylinder_poly(h=block_d+2*e, r=2.8); } } } module switch_arm(h) { arm_w = 17; // arm radius arm_d = 3.8; // arm center circle radius arm_h = 3.7; //3.5 // arm total depth arm_inset_h = 1.7; switch_h = 8.5; switch_w = 20; switch_d = arm_h; // Required area is that which holds the servo arm required_h = arm_d + arm_w + 2*wall; difference() { // stick bit cube_fillet([2*(arm_d+wall),h-switch_h,arm_h], vertical=[0,0,arm_d,arm_d], $fn=24); // servo arm inset translate([arm_d+wall,arm_d+wall,-e]) { cylinder_poly(r=arm_d, h=arm_h+2*e); translate([0,0,arm_inset_h+e]) linear_extrude(arm_h-arm_inset_h+e) polygon(points=[[-arm_d*0.90,0], [-arm_d*0.5,arm_w+0.01], [arm_d*0.5, arm_w+0.01], [arm_d*0.90, 0]]); } } // difference // Holder of the microswitch color("orange") translate([-2,h-switch_h,0]) { difference() { cube_fillet([switch_w,switch_h,switch_d], vertical=[2,2,2,2], $fn=4); // Holder screwholes translate([switch_w-15,switch_h/2,-e]) cylinder_poly(r=M2p5_clear/2, h=switch_d+2*e); translate([switch_w-5,switch_h/2,-e]) cylinder_poly(r=M2p5_clear/2, h=switch_d+2*e); } // diff } // translate+rotate } block_w_servo(15); translate([-25,0,0]) switch_arm(31); translate([15+servo_width/2,servo_ear_depth,29+10]) rotate([0,180,0]) color("gray") SG90();