$fn=36; use Type=0; //0=6x6 horizontal 1=6x6 vertical 2=12x12 horizontal 3=12x12 vertical Knob_height=10; //Only knob height Solder=0; module Push_button(Type,Knob_height,Solder) { if(Type==0) translate([0,1.27,1]) difference() { union() { color("Black") hull() { translate([3,3,0.25]) sphere(d=0.5); translate([3,-3,0.25]) sphere(d=0.5); translate([-3,3,0.25]) sphere(d=0.5); translate([-3,-3,0.25]) sphere(d=0.5); translate([3,3,3-0.25]) sphere(d=0.5); translate([3,-3,3-0.25]) sphere(d=0.5); translate([-3,3,3-0.25]) sphere(d=0.5); translate([-3,-3,3-0.25]) sphere(d=0.5); } color("Silver") hull() { translate([3-0.5,3-0.5,3-0.15]) sphere(d=0.5); translate([3-0.5,-3+0.5,3-0.15]) sphere(d=0.5); translate([-3+0.5,3-0.5,3-0.15]) sphere(d=0.5); translate([-3+0.5,-3+0.5,3-0.15]) sphere(d=0.5); } color("Black") { translate([3-1,3-1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([3-1,-3+1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([-3+1,3-1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([-3+1,-3+1,3+0.1]) scale([1,1,0.5]) sphere(d=1); } color("Silver") { translate([2.54,0,0.5]) cube([0.6,7.93,0.3],center=true); translate([-2.54,0,0.5]) cube([0.6,7.93,0.3],center=true); translate([-2.54,-2.54*1.5,-1.5]) cube([0.6,0.3,4],center=true); translate([2.54,-2.54*1.5,-1.5]) cube([0.6,0.3,4],center=true); translate([-2.54,2.54*1.5,-1.5]) cube([0.6,0.3,4],center=true); translate([2.54,2.54*1.5,-1.5]) cube([0.6,0.3,4],center=true); } color("Black") translate([0,0,1]) cylinder(d=3.5,h=2+Knob_height); if(Solder==1) { color("Silver") translate([2.54,2.54*1.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,2.54*1.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([2.54,-2.54*1.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,-2.54*1.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); } } } if(Type==1) translate([0,0.5,5]) rotate([90,0,0]) union() { color("Black") hull() { translate([3,3,0.25]) sphere(d=0.5); translate([3,-3,0.25]) sphere(d=0.5); translate([-3,3,0.25]) sphere(d=0.5); translate([-3,-3,0.25]) sphere(d=0.5); translate([3,3,3-0.25]) sphere(d=0.5); translate([3,-3,3-0.25]) sphere(d=0.5); translate([-3,3,3-0.25]) sphere(d=0.5); translate([-3,-3,3-0.25]) sphere(d=0.5); } color("Silver") hull() { translate([3-0.5,3-0.5,3-0.15]) sphere(d=0.5); translate([3-0.5,-3+0.5,3-0.15]) sphere(d=0.5); translate([-3+0.5,3-0.5,3-0.15]) sphere(d=0.5); translate([-3+0.5,-3+0.5,3-0.15]) sphere(d=0.5); } color("Black") { translate([3-1,3-1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([3-1,-3+1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([-3+1,3-1,3+0.1]) scale([1,1,0.5]) sphere(d=1); translate([-3+1,-3+1,3+0.1]) scale([1,1,0.5]) sphere(d=1); } color("Silver") { translate([2.54,-7,0.5]) cube([0.6,9,0.3],center=true); translate([-2.54,-7,0.5]) cube([0.6,9,0.3],center=true); } color("Black") translate([0,0,1]) cylinder(d=3.5,h=2+Knob_height); if(Solder==1) { color("Silver") translate([2.54,-2.54*1.96,0.5]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,-2.54*1.96,0.5]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); } } if(Type==2) translate([0,1.27,1]) difference() { union() { color("Black") hull() { translate([6,6,0.25]) sphere(d=0.5); translate([6,-6,0.25]) sphere(d=0.5); translate([-6,6,0.25]) sphere(d=0.5); translate([-6,-6,0.25]) sphere(d=0.5); translate([6,6,3.45]) sphere(d=0.5); translate([6,-6,3.45]) sphere(d=0.5); translate([-6,6,3.45]) sphere(d=0.5); translate([-6,-6,3.45]) sphere(d=0.5); } color("Silver") hull() { translate([5.5,5.5,3.55]) sphere(d=0.5); translate([5.5,-5.5,3.55]) sphere(d=0.5); translate([-5.5,5.5,3.55]) sphere(d=0.5); translate([-5.5,-5.5,3.55]) sphere(d=0.5); } color("Black") { translate([4.5,4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([4.5,-4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([-4.5,4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([-4.5,-4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); } color("Silver") { translate([2.54,0,0.5]) cube([0.6,7.93,0.3],center=true); translate([-2.54,0,0.5]) cube([0.6,7.93,0.3],center=true); translate([-2.54,-2.54*2.5,-1]) cube([0.6,0.3,3],center=true); translate([2.54,-2.54*2.5,-1]) cube([0.6,0.3,3],center=true); translate([-2.54,2.54*2.5,-1]) cube([0.6,0.3,3],center=true); translate([2.54,2.54*2.5,-1]) cube([0.6,0.3,3],center=true); } color("Black") translate([0,0,1]) cylinder(d=6.7,h=2.5+Knob_height); if(Solder==1) { color("Silver") translate([2.54,2.54*2.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,2.54*2.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([2.54,-2.54*2.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,-2.54*2.5,-1]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); } } } if(Type==3) translate([0,0.5,8]) rotate([90,0,0]) difference() { union() { color("Black") hull() { translate([6,6,0.25]) sphere(d=0.5); translate([6,-6,0.25]) sphere(d=0.5); translate([-6,6,0.25]) sphere(d=0.5); translate([-6,-6,0.25]) sphere(d=0.5); translate([6,6,3.45]) sphere(d=0.5); translate([6,-6,3.45]) sphere(d=0.5); translate([-6,6,3.45]) sphere(d=0.5); translate([-6,-6,3.45]) sphere(d=0.5); } color("Silver") hull() { translate([5.5,5.5,3.55]) sphere(d=0.5); translate([5.5,-5.5,3.55]) sphere(d=0.5); translate([-5.5,5.5,3.55]) sphere(d=0.5); translate([-5.5,-5.5,3.55]) sphere(d=0.5); } color("Black") { translate([4.5,4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([4.5,-4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([-4.5,4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); translate([-4.5,-4.5,3.75]) scale([1,1,0.5]) sphere(d=1.5); } color("Silver") { translate([2.54,-9,0.5]) cube([0.6,7.93,0.3],center=true); translate([-2.54,-9,0.5]) cube([0.6,7.93,0.3],center=true); } color("Black") translate([0,0,1]) cylinder(d=6.7,h=2.5+Knob_height); if(Solder==1) { color("Silver") translate([2.54,-2.54*3.15,0.5]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); color("Silver") translate([-2.54,-2.54*3.15,0.5]) rotate([0,0,0]) scale([1,1,1.1]) sphere(d=2); } } } } Push_button(Type,Knob_height,Solder); *PCB(100,100,1,2.54,1);