$fn = $preview ? 16 : 72; module button_foot(height = 4, diameter = 18, hole_width = 5) { button_offset = 1; foot_length = diameter/2+16; outside = 2; foot_height = height+button_offset; foot_width = 15; hole_diameter = 3; hole_clearance = hole_width; hole_spacing = hole_clearance - hole_diameter; rim_h = 1; //bottom difference(){ union(){ cylinder(d=diameter+2*outside,h=foot_height); translate([-foot_width/2,0,0]) cube([foot_width,foot_length,foot_height]); } //slot translate([-hole_clearance/2,-diameter,-1]) cube([hole_clearance,diameter,foot_height+2]); //button insert translate([0,0,button_offset]) cylinder(d=diameter,h=foot_height); //rim translate([-diameter/2-outside-2,-diameter,button_offset+rim_h]) cube([diameter+2*outside+4,diameter,foot_height+2]); //wire slots hull(){ translate([hole_spacing/2,0,-1]) cylinder(d=hole_diameter*1.1,button_offset+2); translate([-hole_spacing/2,0,-1]) cylinder(d=hole_diameter*1.1,button_offset+2); translate([0,hole_spacing/2,-1]) cylinder(d=hole_diameter*1.1,button_offset+2); } // size indication translate([0,foot_length-1,foot_height]){ linear_extrude(height=0.4,center = true) text(text=str(floor(diameter)),size=8,halign="center",valign="top"); translate([0,-10,0]) linear_extrude(height=0.4,center = true) text(text=str("mm"),size=5,halign="center",valign="top"); } } }