Source

uniqxstuff / openscad / cube_cage2 / mount.scad

Full commit

// parameter

material_height = 5;

electronics_height = 2.1;

// place parts

translate([0,0,material_height]) rotate([90,0,0])
  mount(material_height,electronics_height);


// shape definitions

module mount(mh,eh){

  difference(){

    union(){

      translate([0,0,-mh])
        intersection(){
          cylinder(r=mh,h=2*mh,$fn=300);
          cube(mh*[1,1,2]);
        }

      translate(mh*[-1,0,-0.5])
        cube(mh*[1,1,1]);
      translate(mh*[-1,-1,-0.5])
        cube(mh*[1,1,1]);
      translate(mh*[0,-1,-0.5])
        cube(mh*[1,1,1]);

    }

    translate([0,0,-eh/2])
      cube([2*mh,2*mh,eh]);

  }
}