Openscad

To get this:

You need this:

// All measurements are in mm

/* the text in comments and between [] get picked up the openscad customizer, that is so cool */
/* [height] */
roll_height = 70;
/* [half height] */
half_height=1; // [1,2]
/* [width] */
roll_width = 47.12;
/* [inner role] */

inner_roll_diameter = 57;
/* [wall and floor thickness] */
wall_thickness = 2; // [1,1.5,2, 2.5,3,3.5,4,5] 
/* [ring thickness] */
ring_thinkness = 3.23;
/* [number of dividers] */
number_of_dividers = 0; // [ 0,1,2]
/* [cylinder quality] */
$fn=60; // [50:100]

/* [Hidden] */
total_length = roll_width+inner_roll_diameter;
cubewidth=8;
union() {
    
  difference() {
    union() {
      translate([total_length-(cubewidth/1.8),cubewidth/2,((roll_height/half_height)/2)]) 
        cube([cubewidth,cubewidth, (roll_height/half_height)], center=true);
        difference() {
          drawer(); // this draws the outer box
          drawer(wall_thickness); // this draws the inner box that makes it hollow  
        }
      }
      removeExtraStuff(); // it draws a complete cylinder, this removes 3/4 of it and makes the hole
    }
    endplanks();
    if(number_of_dividers == 1) {
      divider(45);
    }
    if(number_of_dividers == 2) {
      divider(30);
      divider(60);
    }
}

module connector(cubewidth=5, cylinder_radius=1.5) {
  translate([total_length-(cubewidth/1.8),cubewidth/2,((roll_height)/2)])
    cube([cubewidth,cubewidth, (roll_height/half_height)], center=true);
}

module divider(angle=45) {
  middle_x = inner_roll_diameter * sin(angle);
  middle_y = inner_roll_diameter * cos(angle);
  translate([middle_x, middle_y, 0]) 
    rotate([0,0,90-angle]) 
      cube([roll_width, wall_thickness,(roll_height/half_height)]);
}

module drawer(offset=0) {
  translate([0, 0, offset])
    difference() {
      difference() {
        cylinder(r=total_length-offset, h=(roll_height/half_height)-offset);
        cylinder(r=inner_roll_diameter+offset, h=(roll_height/half_height)-offset);
      }
    }
}

module endplanks() {
  union() {
    translate([inner_roll_diameter,0,0])
      cube([roll_width, wall_thickness, roll_height/half_height]);
      translate([0,inner_roll_diameter,0])
        cube([wall_thickness, roll_width, roll_height/half_height]);
    }
}
module removeExtraStuff() {
  union() {
    translate([-total_length,-total_length,-1])
      cube([total_length*2, total_length, roll_height+10]);
    translate([-total_length,0, -1])
      cube([total_length, total_length, roll_height+10]);
  }
  translate([total_length-(8/1.8),4,roll_height/2])
    cylinder(r=1.5, h=roll_height+5, center=true);
}
comments powered by Disqus
comments powered by Disqus