modules.scad 1.56 KB
include<vars.scad>

module materialDot(radius, height, roundness) {
  roundness = roundness >= height/2 ? height/2-0.000001 : roundness;
  translate([0,0, roundness]) minkowski() {
    linear_extrude( height = height-roundness*2
                    , convexity = 10
                    , twist = 0 )
      circle( r=radius-roundness);
    sphere(r=roundness);
  }
}

module shapeZ(x,y,z) {
  translate([0,0,-25]) minkowski() {
    cube([
          x-(offset)*2,
          y-(offset)*2,
          1
          ]);
    cylinder(
             r=offset,
             h=50
             );
  }
}

module handleShape(x,y,z,extra,bool,borders){
  translate([
             x/2 - handleWidth/2 - offset,
             -( offset+1 ),
             z-(2.06+roundborderInner+strength*3)
             ]) {
    hull() {
      translate([-extra,0,-1])cube([handleWidth+extra*2,5,1]);
      translate([handleCorner,0,handleCorner-handleHeight]) rotate([-90,0,0]) union() {
        cylinder(r=handleCorner+extra,h=5);
        translate([handleWidth-handleCorner*2,0,0]) cylinder(r=handleCorner+extra,h=5);
      }
    }
    if(borders==true) translate([-strength*2,0+gratesize+1,-4.5])
                        cube([handleWidth+strength*4,2,6]);

    if(bool==true) {
      if(borders==true) translate([-strength*2,0,-0.5])
                          cube([handleWidth+strength*4,1,2]);
      hull() {
        translate([-strength*2,0,-1.5])
          cube([handleWidth+strength*4,1,1]);
        translate([-strength*2,0.85,-(1+handleHeight+strength)])
          cube([handleWidth+strength*4,1,1]);
      }
    }
  }
}