handles.scad 2.07 KB
include<vars.scad>
include<modules.scad>


/* handleShape(10,10,10); */
module handleBlock(x,y,z,exploded) {
  overlap=0.05;
  over=0.2;
  translate([offset, offset, roundborderInner+strength]) {
    difference() {
      intersection() {
        /* #handleShape(x,y,z,strength,bool=true); */
        /* difference() { */
        /* handleShape(x,y,z,0,bool=false); */
        translate([x/2-8.5-overlap,-2.2-overlap-over,z-6.31-overlap])
          /* difference() { */
          cube([12.635+(overlap*2),1.7+(overlap)+(over*2),3+(overlap*2)]);
          /* #translate([-1,1.2,0]) cube([2,0.7,2]); */
        /* } */
        handleShape(x,y,z,0,bool=true, borders=true);
        translate([x/2-8.5-overlap,-2.2-overlap-over,z-6.31-overlap]) {
          union() {
            translate([-1,1.25+over,0]) cube([15,0.7,4]);
            rotate([-20,0,0]) translate([4,-1,3-over*2]) cube([4.3,3,4]);
            rotate([35,0,0]) translate([4,0.7,-4.2]) cube([4.3,1,4]);
          }
        }

        /* } */
        /* translate([0,y-4,0])mirror([0,1,0]){ */
        /*   handleShape(x,y,z,strength,bool=false); */
        /* } */
      }
      translate([x/2-8.5-overlap,-2.2-overlap-over,z-6.31-overlap])
        translate([1,1,1])
        cube([10.8,2,1]);
    }
  }
}

module handle(x,y,z,inner,exploded) {
  gitterdicke=0.1;
  durchschuss=0.025;
  clip=0.05;
  if ( inner ) {
    translate(exploded*2)
      intersection() {
      handleBlock(x,y,z,exploded);
      translate([x/2-5.66,0.8,z-5.11-clip])
        /* translate([1,1,1]) */
        cube([11.4,0.7-gitterdicke/2,1.88+clip*2]);
    }
  } else {
    translate(exploded) {
    difference() {
      handleBlock(x,y,z,exploded);
      translate([x/2-5.66-durchschuss,0.8-durchschuss,z-5.11-clip-durchschuss])
        /* translate([1,1,1]) */
        cube([11.4+durchschuss*2,0.7+gitterdicke/2+durchschuss*2,1.88+clip*2+durchschuss*2]);
    }
  }
}


}

module handles(x,y,z,exploded) {
  handle(x,y,z,false,exploded);
  handle(x,y,z,true,exploded);
  mirror([0,1,0]) translate([0,-y,0]) {
    handle(x,y,z,false,exploded);
    handle(x,y,z,true,exploded);
  }
}