The inspiration from this piece came from work I am doing with Colin Pinto and Crusic Percussion. They are working on making digitally fabricated marimbas, so I decided to make parametric marimba keys where you can set an octave of C and it spits out a key.
thingiverse: http://www.thingiverse.com/thing:233060
//Kevyn McPhail //Interactive Art + Computational Design //Parametric Object(Marimba Keys) //Enter Note (C no sharps or flats) note = "C"; //Enter Octave (2 to 7) octave = 3; // estimated width equation: w = (0.1373*l) + 0.349 // estimated thickness equation: barT = (0.0532*l) + 0.2417 // estimated arch thichness equation: archT = -0.0234x + 0.7127 //estimated arch length equation: archL = 0.9857x - 6.7525 lengths = [23.0937,17.34375,14.4375,12.15625,9.4375,7.6875]; //Get key length function getKeyLength(oct) = lengths[oct - 2]; l = getKeyLength(octave); echo(l); //Get key width function getKeyWidth(length) = (0.1373*length) + 0.349; w = getKeyWidth(l); //Get key Thickness function getKeyThickness(length) = (0.0532*length) + 0.2417; barT = getKeyThickness(l); //get arch thickness function getArchThickness(length) = (-0.0234*length) + 0.712; archT = getArchThickness(l); //get arch length function getArchLength(length) = abs((0.9857*length) - 6.7525); archL = getArchLength(l); //Generate blank bar //cube([l,w,barT]); //Generate Arch Piece //rotate([0,0,0])cube([(l-((barT-archT)*2)),w*2,(barT-archT)]); //for(i = [2,l -2]){ //translate([i,5,barT/2])rotate([90,0,0])cylinder(h = 10, r=.4); //} minkowski(){ sphere(.2); difference(){ difference(){ cube([l,w,barT],center = true); minkowski(){ sphere(.8); translate([0,0,-1])cube([archL,w*2,(barT-archT)],center = true); } } for(i = [(l-archL),-1*((l-archL))]){ translate([i,5,barT/6])rotate([90,0,0])cylinder(h = 10, r=barT/3); } } } |