Loading

Report as inappropriate

So, I've played with this, and while I love it, I cna't make the PCB feet work the way they should with your code. By default, they're a seemingly random 13,12 off from the origin. Not a big deal for large boxes, but really a pain if you're trying to make a box for something small, like a single relay.

Also, you have a nice filet on the feet, but they're set well below the inside surface of the box. I re-wrote the feet sections to correct this.

With this altered code, the PCB feet will be raised up so they sit exactly on the surface of the inside of the box, regardless of how thick the box is. No more making manual adjustments. Likewise, they'll be moved in the X and Y directions 'just' far enough to account for the thickness of the box, the size of the PCB post (including the filet), and even the tolerance for the end plate. Adjust it all however you want, the PCB feet will start out as far to the o,o corner as they can. (this does not account for the filet of the outside of the box, so if you have very round corners and very thin walls, you might have to move them +y to compensate, but you'll still be starting from a sane location)

One last note before I post the code, this came from the 'Ultimate Panel and Box maker' linked in the description, rather than the one for download under 'Thing Files.' So, if you want to use this code, you should probably add it to the one in the link, rather than the one here.

/////////////////////// - Foot with base filet - /////////////////////////////
module foot(FootDia,FootHole,FootHeight){
Filet=2;
color(Couleur1)
translate([(Thick*3)+(FootDia/2)+(Filet/2)+m,(Thick)+(FootDia/2)+(Filet/2),Thick])
difference(){

difference(){
        //translate ([0,0,0]){
            cylinder(d=FootDia+Filet,FootHeight, $fn=100);
                    //}
                rotate_extrude($fn=100){
                        translate([(FootDia+Filet*2)/2,Filet,Thick]){
                                minkowski(){
                                        square(10);
                                        circle(Filet, $fn=100);
                                    }
                             }
                       }
               }
        cylinder(d=FootHole,FootHeight+1, $fn=100);
           }          

}// Fin module foot

module Feet(){
//////////////////// - PCB only visible in the preview mode - /////////////////////
translate([(Thick*3)+(FootDia/2)+(Filet/2)-5+m,(Thick)+(FootDia/2)+(Filet/2)-5,FootHeight+(Thick/2)-0.5+Thick]){

%square ([PCBLength+10,PCBWidth+10]);
   translate([PCBLength/2,PCBWidth/2,0.5]){ 
    color("Olive")
    %text("PCB", halign="center", valign="center", font="Arial black");
   }
} // Fin PCB 

////////////////////////////// - 4 Feet - //////////////////////////////////////////
translate([0,0,0]){
foot(FootDia,FootHole,FootHeight);
}
translate([PCBLength,0,0]){
foot(FootDia,FootHole,FootHeight);
}
translate([PCBLength,PCBWidth,0]){
foot(FootDia,FootHole,FootHeight);
}
translate([0,PCBWidth,0]){
foot(FootDia,FootHole,FootHeight);
}

} // Fin du module Feet