//------------------------------------------------------------------------- //-- YATH: Yet another Tool Holder, by Obijuan //--------------------------- //-- (c) Juan Gonzalez-Gomez (Obijuan) Jan-2013 //--------------------------------------------------- //-- GPL license //------------------------------------------------------------------------- //---------------------------------------------------- //-- Tool holder module //---------------------------------------------------- module tool_holder (ilength = 17, //-- Internal length (x-axis) iwidth = 3.5, //-- Internal width (y-axis) height = 10, //-- Height (z-axis) thickness = 3, base_thickness = 7, //-- Length of the rear open=true) //-- Mode. True=Open, False=Close { //-- For easily accesing the vector components X = 0; Y = 1; Z = 2; //----- Calculated parameters ---- //-- Obtained from the user parameters //-- Outer-cube oc_size = [ilength + 2*thickness, iwidth + 2*thickness, height]; //-- Inner cube ic_size = [ilength, iwidth, height+2]; //-- Base cube b_size = [oc_size[X], base_thickness, height]; //-- Main holder difference() { //-- Main body cube(oc_size, center=true); //-- Inner room cube(ic_size, center=true); //-- Depending on the mode: open or close the front if (open==true) translate([0, -iwidth/2-thickness/2, 0] ) cube([ilength - 3*2, iwidth+2, height+2], center=true); } //-- Add the rear color("green") translate([0, b_size[Y]/2 + oc_size[Y]/2, 0]) cube(b_size, center=true); } module hook(h_lx, h_ly, h_lz) { hook_size = [h_lx, h_ly, h_lz]; ihook_size = hook_size + [0, -2*3, 2]; difference() { cube(hook_size, center=true); translate([-3, 0, 0]) cube(ihook_size, center=true); translate([-6, -3, 0]) cube(hook_size+[0,0,5], center=true); } } //---------------------------------------------------------------- //-- Examples //-- Remove the * on the specific tool holder you want to render //---------------------------------------------------------------- //-- Wrench 12/13 *tool_holder(); //-- rectangular File *tool_holder(base_thickness = 15); //-- Round file *tool_holder(base_thickness = 15, iwidth = 5, ilength = 8, open=false); //-- Pliers *tool_holder(iwidth = 6.5, open=false); //-- Pliers 2 *tool_holder(iwidth = 12, ilength = 30, open=false); //-- Caliper *tool_holder(ilength = 17, iwidth = 6, open=false); //-- cutter *tool_holder(ilength = 32, iwidth = 17, base_thickness=3, open=false); //-- Screwdrivers *tool_holder(ilength = 16, iwidth = 20, height = 6, base_thickness=3, open=true); //-- Hook hook(h_lx = 16, h_ly = 36, h_lz = 6);