Files
Parametric_Vase-mode_Compon…/drawers_and_frame.scad

220 lines
5.8 KiB
OpenSCAD

// Parametric Vase-Mode Parts Cabinet
// Scott Alfter
// 3 Oct 18
// https://www.printables.com/model/189349-parametric-vase-mode-component-drawers
//
// Add: Divisions/Compartments
// Add: Extra wall to block drawer hole
// Jose Ferreira - 13 March 21
// https://www.printables.com/model/225855-parametric-vase-mode-drawers-with-dividers
//
// CC-BY
make_frame=0; // 0=make drawer, 1=make frame
// drawer parameters
width=40; // width
height=20; // height
depth=80; // depth
y_divisions=3; // vertical divisions
enable_extra_wall=1; // set to 1 to enable
// If you are using a transparent filament, you can use the pocket created by the extra wall to put your tag
enable_tag_holder=0; // set to 0 to disable (auto-disabled for width<18mm or height<12mm),
// frame parameters
x_count=4; // number of columns of drawers
y_count=4; // number of rows of drawers
// printer and slicer parameters
gap=0.05; // width of cuts to make (adjust if needed to slice correctly)
nozzle_width=0.4; // nozzle width
base_thickness=0.55; // thickness of first two layers
// nothing configurable below here
y_spacing=depth/y_divisions; // spacing between divisions
total_width=x_count*(width+2)+(x_count-1)*gap; // frame width
total_height=y_count*(height+2)+(y_count-1)*gap; // frame height
module drawer()
{
$fn=30;
difference()
{
difference()
{
// main body
translate([2,2,0])
minkowski()
{
cylinder(r=2, h=height/2);
cube([width-4,depth-4,height/2]);
}
// chamfer underneath
translate([width,0,0])
rotate([90,-90,-90])
linear_extrude(width, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
translate([0,depth,0])
rotate([180,-90,0])
linear_extrude(width, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
rotate([90,-90,180])
linear_extrude(depth, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
translate([width,depth,0])
rotate([90,-90,0])
linear_extrude(depth, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
}
// Extra wall
if(enable_extra_wall)
{
translate([0,4*nozzle_width, base_thickness])
cube([width-2*nozzle_width,gap,height]);
}
// Y Divisions
for(i= [1:y_divisions])
{
translate([0,y_spacing*i,base_thickness])
cube([width-2*nozzle_width,gap,height]);
}
}
// handle
translate([width/2-3,0.05,4.5])
rotate([-90,0,-90])
linear_extrude(6, convexity=10)
polygon([[0,0],[0,4],[4,0]]);
// tag holder
if (width>=18 && height>=12 && enable_tag_holder==1)
{
translate([3,.05,0])
drawer_tag_holder();
translate([width-3,.05,0])
mirror([1,0,0])
drawer_tag_holder();
}
}
module drawer_tag_holder()
{
translate([2*nozzle_width+2,0,4.5])
difference()
{
rotate([90,0,-90])
linear_extrude(2*nozzle_width+2, convexity=10)
polygon([[0,0],[0,height-4.5],[4*nozzle_width,height-4.5],[4*nozzle_width,4*nozzle_width]]);
translate([0,0,4*nozzle_width])
rotate([90,0,-90])
linear_extrude(2, convexity=10)
polygon([[0,0],[0,height-4.5-4*nozzle_width],[2*nozzle_width,height-4.5-4*nozzle_width],[2*nozzle_width,0]]);
}
}
module frame_base()
{
difference()
{
// main body
cube([total_width,total_height,depth]);
// chamfer
translate([total_width,0,0])
rotate([90,-90,-90])
linear_extrude(total_width, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
translate([0,total_height,0])
rotate([180,-90,0])
linear_extrude(total_width, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
rotate([90,-90,180])
linear_extrude(total_height, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
translate([total_width,total_height,0])
rotate([90,-90,0])
linear_extrude(total_height, convexity=10)
polygon([[0,0],[0,.5],[.5,0]]);
}
}
module frame(c,d)
{
difference()
{
frame_base();
if (d==1)
{
if (c>1)
for (i=[1:c-1])
translate([i*total_width/x_count-gap/2,0,base_thickness])
cube([gap,total_height-2*nozzle_width,depth]);
}
else if (c==1)
{
if (d>1)
for (i=[1:d-1])
translate([0,i*total_height/y_count-gap/2,base_thickness])
cube([total_width-2*nozzle_width,gap,depth]);
}
else
{
if (d>1)
translate([0,total_height/y_count-gap/2,base_thickness])
cube([total_width-2*nozzle_width,gap,depth]);
if (c>1)
for (i=[1:c-1])
translate([i*total_width/x_count-gap/2,2*nozzle_width,base_thickness])
cube([gap,total_height-4*nozzle_width,depth]);
if (c>1 && d>1)
for (i=[0:c-2])
for (j=[1:d-1])
translate([i*total_width/x_count+2*nozzle_width,j*total_height/y_count-gap/2,base_thickness])
cube([total_width/x_count-2*nozzle_width,gap,depth]);
if (c>1 && d>1)
for (i=[1:d-1])
translate([(c-1)*total_width/x_count,i*total_height/y_count-gap/2,base_thickness])
cube([total_width/x_count-2*nozzle_width,gap,depth]);
}
}
}
if (make_frame==1)
frame(x_count,y_count);
else
drawer();