$fn=30; // Spiral used to form a coil spring module spiral(r, h, thickness, loops) { linear_extrude(height=h) polygon(points= concat( [for(t = [90:360*loops]) [(r-thickness+t/90)*sin(t),(r-thickness+t/90)*cos(t)]], [for(t = [360*loops:-1:90]) [(r+t/90)*sin(t),(r+t/90)*cos(t)]] )); } r=1; h=2; thickness=1.5; loops=5; // Square hole difference(){ union(){ cylinder(r=4.8,h=h); spiral(r, h, thickness, loops); } translate([-2.6,-2.6,0]) cube([5.2,5.2,5+h]); } // Hole at outer edge to attach switch contact translate([3, thickness + 4 * loops+1, 0]) difference(){ // Cube hole at outer axle cylinder(r=5,h=h); cube([5.2,5.2,5+h], center=true); // Cylidrical hole at outer axle //cylinder(r=4,h=h); //cylinder(r=2.1,h=4); }