1. uniqx
  2. uniqxstuff

Source

uniqxstuff / openscad / cube_cage2 / lazzor_parts.scad



// parameters


height = 90;
width  = 100;
depth  = 160;

material_height = 5;
screw_radius = 1.5;

usb_height = 12;
usb_width = 13;
usb_x = 1.5;
usb_y = 32;

// arrangement


translate([ (3*width/2) + material_height*4,0,0])
  base_plate(width,depth,material_height,screw_radius);
translate([ (width/2) + material_height,0,0])
  base_plate(width,depth,material_height,screw_radius);

rotate([0,0,90]) translate([ 0,height*1.6,0 ])
  side_plate(depth,height,material_height);
rotate([0,0,90]) translate([ 0,height*0.55,0 ])
  side_plate(depth,height,material_height);

translate( [2.85*width,height*0.55-material_height*2,0] ) rotate([0,0,90])
  front_plate(height,width,material_height);
translate( [2.85*width,-height*0.55-material_height,0] ) rotate([0,0,90])
  back_plate(height,width,material_height,usb_height,usb_width,usb_x,usb_y);


// shapes

module back_plate(h,w,m,uh,uw,ux,uy){

  difference(){

    front_plate(h,w,m);

    translate([h/2-5*m/2-uh/2-ux,w/2-uw/2-uy,0])
      square([uh,uw],center=true);
  }
}

module front_plate(h,w,m){

  difference(){

    union(){

      square([h,w],center=true);

      for(a=[-1,1])
        for(b=[-1,1])
          for( i=[0:m*2:(4-1)*m] )
            translate([-a*i+a*h/2-a*m/2,b*w/2+b*m/2])
              square([m,m],center=true);

    }

  for(i=[-1,1])
    translate([h/2-5*m/2,i*w/2,0])
      square([m,2*m],center=true);

  }

}

module side_plate(h,w,m){

  difference(){

    square([h+2*m,w],center=true);

    //translate([h/2+m/2,w/2-m/2,0])
    //  square([m,m],center=true);

    for(a=[-1,1])
      for(b=[-1,1])
        for( i=[m:m*2:4*m] )
          translate([b*h/2+b*m/2,a*w/2-a*i+a*m/2,0])
            square([m,m],center=true);

    for(i=[-1,1])
      translate([i*h/2-m/2*i,-w/2+m*5/2,0])
        square([m,m],center=true);

  }

}

module base_plate(h,w,m,sr){

  difference(){

    square([h+m*2,w+m*2],center=true);

    for( a = [-1,1] )
      for( b = [-1,1] )
        translate([a*(h+m)/2,b*(w+m)/2]) circle(r=sr,$fn=100);

  }

}