drillguide.scad 2.53 KB
use<eurobox.scad>
use<lid.scad>
use<cuts.scad>
use<screws.scad>
use<pipes.scad>
include<vars.scad>

module guideside(guideover,shift,long) {
  cube([70+long,21.5,guideover]);
  cube([20,20,30]);
  translate([68+long,0,0]) cube([2,18,27]);

}

module guideedge(guideover,shift) {
  translate([-5,-5,5]) guideside(guideover,shift,0);
  /* rotate([0,0,90]) translate([-5,-16.5,5]) guideside(guideover,shift,11); */
  rotate([0,0,90]) mirror([0,1,0]) translate([-5,-5,5]) guideside(guideover,shift,11);
}

module drillcorner(x,y,z) {
  union(){
    mirror([0,0,1]) translate([0,0,-18])guideedge(8,0);
    translate([0,0,-22]) guideedge(8,0);
    /* translate([0,0,z+9]) mirror([0,0,1]) guideedge(1); */
    translate([0,0,z+9+12]) mirror([0,0,1]) guideedge(5,0);
    translate([0,0,z+10]) mirror([0,0,1]) guideedge(10,0);
    translate([0,0,z-28]) guideedge(5,0);

    /* translate([55,-5,10]) cube([15,8,5]); */
    /* translate([55,-5,z-8]) cube([15,8,5]); */

    /* mirror([1,1,0]) translate([-85,-3,10]) cube([15,8,5]); */
    /* mirror([1,1,0]) translate([-85,-3,z-8]) cube([15,8,5]); */
  }
}
module drillguide(x,y,z) {
  difference() {
    union() {

      /* translate([x,0, 0]) mirror([1,0,0]) grates(x,y,z) */
      translate([x,0, 0]) mirror([1,0,0]) drillcorner(x,y,z);

      translate([0,y, 0]) mirror([0,1,0])
      translate([x,0, 0]) mirror([1,0,0])
        drillcorner(x,y,z);

      /* } */
      /* translate([0,-offset*2+y, 0]) mirror([0,1,0]) { */
      /*   union() { */
      /*     grates(x,y,z); */
      /*     translate([-offset*2+x,0, 0]) mirror([1,0,0]) grates(x,y,z); */

      /* drillcorner(x,y,z); */
    }
    union() {
      eurobox(x,y,z,
      handle=false,
        handlecaps=false,
        pipes=false,
        drilled=false,
        screws=false,
        locked=false,
        exploded=false
        );
    insert=13;
    translate([insert,insert,z-3.5]) cube([x-insert*2,y-insert*2,2]);
    translate([insert,insert*2,z-5.5]) cube([x-insert*2,y-insert*4,2]);
    /* translate([insert,insert,z-19.5]) cube([x-insert*2,y-insert*2,2]); */
    translate([insert,insert,z-23]) cube([x-insert*2,y-insert*2,2]);
    translate([0,0,-20])drills(x,y,z,hull=false);
    translate([x-6,y-6,7.5]) cylinder(r=2,h=z-7.5,fn=6);
    translate([x-6,6,7.5]) cylinder(r=2,h=z-7.5,fn=6);
    }
  }
}

drillguide(300,400,220);
/* eurobox(300,400,220, */
/*         handle=false, */
/*         handlecaps=false, */
/*         pipes=false, */
/*         drilled=true, */
/*         screws=false, */
/*         locked=false, */
/*         exploded=false */
/*         ); */