Pédale de sustain pour clavier numérique

$fn = 100;

for (e = [0:1])
{
    for (i = [0:1])
    {
        translate([127 + 32*i,32*e,0]) union() // espece de plus
        {
            translate ([3,0,0]) square([24,30]);
            translate([0,7.5,0]) square([3,15]);
            translate([27,7.5,0]) square([3,15]);
        }
    }
}

translate([0,64,0]) for (i = [0:1])
{
    translate([0,35*i,0]) difference() //bras de la pédale
    {
        union()
        {
            square([190,30]);
            translate([5,30,0]) square([10,3]);
            translate([25,30,0]) square([10,3]);
        }
        translate([0,-22.5,0]) rotate([0,0,45]) square([30,30]);
        translate([20,0,0]) square([3,15]);
        translate([150,15,0]) circle(r=4);
        translate([132,7.5,0]) square([3,15]);
        translate([165,7.5,0]) square([3,15]);
        translate([187,7.5,0]) square([3,15]);
        translate([99.5,0,0]) square([15,3]);
        translate([179.5,20,0]) square([3,10]);
    }
}

translate([35,0]) difference() // pédale
{
    minkowski ()
    {
        translate([10,10,0]) square([70,40]);
        circle(r=10);
    }
    translate([10,15,0]) square([10,3]);
    translate([30,15,0]) square([10,3]);
    translate([10,42,0]) square([10,3]);
    translate([30,42,0]) square([10,3]);
    translate([25,5,0]) square([3,10]);
    translate([25,45,0]) square([3,10]);
}

translate([0,60,0]) rotate([0,0,-90]) difference() //dessous pédale
{
    union()
    {
        square([60,30]);
        translate([5,30,0]) square([10,3]);
        translate([45,30,0]) square([10,3]);
    }
    translate([-7,-20.5,0]) rotate([0,0,37]) square([30,30]);
    translate([45,0,0]) rotate([0,0,-37]) square([30,30]);
    translate([15,15,0]) square([3,15]);
    translate([42,15,0]) square([3,15]);
}
translate([60,-3,0]) rotate([0,0,90]) difference() //face superieure
{
    square([115,60]);
    translate([20,9,0]) square([35,2.7]);
    translate([20,48,0]) square([35,2.7]);
    
    union() //crenelage
    {
        translate([0,5,0]) square([3,10]);
        translate([0,25,0]) square([3,10]);
        translate([0,45,0]) square([3,10]);
        translate([112,5,0]) square([3,10]);
        translate([112,25,0]) square([3,10]);
        translate([112,45,0]) square([3,10]);
        translate([12.5,0,0]) square([10,3]);
        translate([32.5,0,0]) square([10,3]);
        translate([52.5,0,0]) square([10,3]);
        translate([72.5,0,0]) square([10,3]);
        translate([92.5,0,0]) square([10,3]);
        translate([12.5,57,0]) square([10,3]);
        translate([32.5,57,0]) square([10,3]);
        translate([52.5,57,0]) square([10,3]);
        translate([72.5,57,0]) square([10,3]);
        translate([92.5,57,0]) square([10,3]);
    }
}

translate([258,-3,0]) rotate([0,0,90]) difference() //base plate
{
    square([220,60]);
    translate([21,9,0]) square([7,2.7]);
    translate([21,48,0]) square([7,2.7]);
    translate([41,9,0]) square([19,2.7]);
    translate([41,48,0]) square([19,2.7]);
    
    union() //crenelage boite
    {
        translate([0,5,0]) square([3,10]);
        translate([0,25,0]) square([3,10]);
        translate([0,45,0]) square([3,10]);
        translate([112,5,0]) square([2.7,9]);
        translate([112,25,0]) square([2.7,10]);
        translate([112,46,0]) square([2.7,9]);
        translate([12.5,0,0]) square([10,3]);
        translate([32.5,0,0]) square([10,3]);
        translate([52.5,0,0]) square([10,3]);
        translate([72.5,0,0]) square([10,3]);
        translate([92.5,0,0]) square([10,3]);
        translate([12.5,57,0]) square([10,3]);
        translate([32.5,57,0]) square([10,3]);
        translate([52.5,57,0]) square([10,3]);
        translate([72.5,57,0]) square([10,3]);
        translate([92.5,57,0]) square([10,3]);
    }
}

translate([65,0,0]) for (i=[0:1]) // faces latérales
{
    translate([68*i,0,0]) union()
    {
        square([60,109]);
        for (i = [0:4])
        {
            translate([60,9.5+20*i,0]) square([3,10]);
        }
        for (i = [0:4])
        {
            translate([-3,9.5+20*i,0]) square([3,10]);
        }
        for(i = [0:2])
        {
            translate([5+20*i,-3,0]) square([10,3]);
        }
        for(i = [0:2])
        {
            translate([5+20*i,109,0]) square([10,3]);
        }
    }
}
translate([3,120,0]) union() //plaque arrière
{
    square([54,60]);
    for(i = [0:2])
    {
        translate([2+20*i,-3,0]) square([10,3]);
    }
    for(i = [0:2])
    {
        translate([2+20*i,60,0]) square([10,3]);
    }
    for(i = [0:1])
    {
        translate([-3,15+20*i,0]) square([3,10]);
    }
    translate([-3,0,0]) square([3,5]);
    translate([-3,55,0]) square([3,5]);
    for(i = [0:1])
    {
        translate([54,15+20*i,0]) square([3,10]);
    }
    translate([54,0,0]) square([3,5]);
    translate([54,55,0]) square([3,5]);
}

translate([68,120,0]) difference()//plaque avant
{
    union() 
    {
        square([54,60]);
        for(i = [0:2])
        {
            translate([2+20*i,-3,0]) square([10,3]);
        }
        for(i = [0:2])
        {
            translate([2+20*i,60,0]) square([10,3]);
        }
        for(i = [0:1])
        {
            translate([-3,15+20*i,0]) square([3,10]);
        }
        translate([-3,0,0]) square([3,5]);
        translate([-3,55,0]) square([3,5]);
        for(i = [0:1])
        {
            translate([54,15+20*i,0]) square([3,10]);
        }
        translate([54,0,0]) square([3,5]);
        translate([54,55,0]) square([3,5]);
    }
    translate([11,-3,0]) square([5,50]);
    translate([38,-3,0]) square([5,50]);
}
for (i = [0:1])
{
    translate([57*i,0,0]) difference() // Support
    {
        union()
        {
            square ([55,60]);
            translate([5,-3,0]) square([19,3]);
            translate([37,-3,0]) square([7,3]);
            translate([10,60,0]) square([35,3]);
        }
        translate([14,30,0]) circle(r=4);
        translate([29,0,0]) square([2.7,10]);
        translate([49,0,0]) square([10,3]);
        translate([49,6,0]) square([10,3]);
    }
    
}

translate([114,0,0]) union() //butée
{
    square([15,36]);
    translate([5,-3,0]) square([10,3]);
    translate([5,36,0]) square([10,3]);
}

for (i = [0,1]) //rondelles
{
    translate ([131,18*i,0]) difference()
    {
        translate([8,8,0]) circle(r=8);
        translate([8,8,0]) circle(r=4);
    }
}