Source

uniqxstuff / openscad / cube_cage / lazor_parts.scad

// parameters

height = 60; // length of the box in z direction
width = 120; // length of the box in x direction
depht = 80; // length of the box in y direction

material_height = 5;
screw_radius = 1.5;
screw_height = 10;

// position parts

xy_plate(width,depht,material_height);
#xz_plate(width,height,material_height);

// shape definitions

module xz_plate(width,height,material_height){

  difference(){

    union(){
      square([width+2*material_height,height],center=true);
      square([width/2,height+2*material_height],center=true);
    }

    translate([3*width/8,-height/2,0])
      screw_socket(screw_radius,screw_height,material_height);
    translate([-3*width/8,-height/2,0])
      screw_socket(screw_radius,screw_height,material_height);

    rotate([0,0,180]) translate([3*width/8,-height/2,0])
      screw_socket(screw_radius,screw_height,material_height);
    rotate([0,0,180]) translate([-3*width/8,-height/2,0])
      screw_socket(screw_radius,screw_height,material_height);

  }

}

module xy_plate(width,height,materiel_height){

  difference(){
    minkowski(){
      square([width,height],center=true);
      circle(r=material_height);
    }

    translate([width/2+material_height,0,0])
      square([material_height*2,height/2],center=true);
    translate([-width/2-material_height,0,0])
      square([material_height*2,height/2],center=true);

    translate([0,height/2+material_height,0])
      square([width/2,material_height*2],center=true);
    translate([0,-height/2-material_height,0])
      square([width/2,material_height*2],center=true);


    translate([3*width/8,height/2+material_height/2,0])
      circle(r=screw_radius,$fn=25);
    translate([-3*width/8,height/2+material_height/2,0])
      circle(r=screw_radius,$fn=25);

    translate([3*width/8,-height/2-material_height/2,0])
      circle(r=screw_radius,$fn=25);
    translate([-3*width/8,-height/2-material_height/2,0])
      circle(r=screw_radius,$fn=25);

  }

}


module screw_socket(screw_radius,screw_height,material_height){

  union(){
    translate([-screw_radius,0,0])
      square([screw_radius*2,screw_height+screw_radius]);
    translate([-2*screw_radius,screw_height-2*screw_radius,0])
      square([screw_radius*4,screw_radius*2]);
  }

}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.