/************** BEST VIEWED IN A CODE EDITOR 80 COLUMNS WIDE ******************* * * Milwaukee Packout Foot * Benjamen Johnson * 20200212 * Version 2 * openSCAD Version: 2019.05 * Licesnse: Creative Commons - Attribution - Share Alike * https://creativecommons.org/licenses/by-sa/4.0/ *******************************************************************************/ /*[Hidden]*/ bottom_widths=[72,174]; /*[Parameters]*/ // Which type of foot (standard or big)? part = 0;//[0:Normal Foot,1:Big Foot] // Whole foot or little foot? (figure out your hole placement first) type = 0; //[0:Whole, 1:Right, 2:Left] // Thickness thickness = 0;//[0:Normal, 1:Thin] // Add some more material to the top of the foot (in mm) extra_height=0;// [0:0.1:3] /*[Screw Parameters]*/ /******************************************************************************* * * |----------|<-- counter_diameter * ---- ---------- --- * | \ / | * | \ / | <--counter_depth * total_ | | --- * depth | | * | | | * | | | * ----- ---- * |----|<-- hole_dia * *******************************************************************************/ // Do you want a counterbore or countersink? hole_type = 0; //[0:Counterbore, 1: Countersink] // Number of holes in first row hole_num = 2;//[0:4] // Spacing between each hole in the first row hole_spacing = 40; // Number of holes in the second row hole_num2 = 0;//[0:4] // Spacing between each hole in the second row hole_spacing2 = 40; // Spacing between the first and second row row_spacing = 25.4; // Diameter of the holes hole_dia = 5; // If you are using countersinks, what angle? countersink_angle = 82; // [60,82,90,100,110,120] // Depth of the countersink or bore counter_depth = 4; // Counterbore diameter (countersink uses depth and angle) counter_dia = 10; /*[Tape Parameters (set holes to 0)]*/ /******************************************************************************* * Inset tape parameters *******************************************************************************/ // Create recess for tape? tape=0;//[0:No Tape, 1:Foam VHB] // How thick is the tape? tape_thickness = 1.0; // What is the width of the tape? tape_width = 20; // How long is the tape? tape_length=40; /*[Fine Tuning]*/ /******************************************************************************* * Fine Tuning the fit of the foot *******************************************************************************/ /******************************************************************************* * * ---------------------- ---- * hy - / \ | * | | | * | | | * | | bottom_y * | | | * | | | * \ / | * ----------------------- ---- * | <------ bottom_x ------>| * * *******************************************************************************/ // Bottom X dimension bottom_x=bottom_widths[part]; // Bottom Y dimension bottom_y=42; // Length of the hypotenuse (cut off corners) hy = 8; // Draft angle of the sides draft_angle = 30; // Height of the foot to the top of the box foot_depth = 11;//11.2 // Height of the tabs tab_depth = 7.5; // Distance from y-axis for notch cutout notch_pos=31; // Diameter of notch cutout notch_dia = 3.5; // Length of notch notch_len = 10; // How far to cut into the X direction of the foot for the tab tab_cutout_x = 11.2; // How far off the X-axis to make the cut for the tab tab_cutout_y = 1; // How much to chamfer the top corners (more = less) top_chamfer=5.5; // How much to chamfer the edges of the tab cutouts chamfer = 2; // How long to make the chamfer on the side of the tab side_chamfer_len = 34; // How thick the thinfoot should be thinfoot_thickness = 6; /*[Hidden]*/ /******************************************************************************* * Calculations *******************************************************************************/ // Total_height of the foot total_depth=foot_depth+extra_height; // position the first and second row of holes correctly hole_offset = hole_num2 ? (row_spacing/2):0; // Calculate the diameter of the countersink hole countersink_dia = 2*tan(countersink_angle/2)*counter_depth; // Figure out where the first row of holes goes hole_pos = hole_spacing*(hole_num-1)/2; // Figure out where the second row of holes goes hole_pos2 = hole_spacing2*(hole_num2-1)/2; // what indent do we need to get the right hypotenuse length indent=sqrt(hy*hy/2); //figure out what scale factos we need to get the proper draft angle scalex=(bottom_x+2*total_depth*tan(draft_angle))/bottom_x; scaley=(bottom_y+2*total_depth*tan(draft_angle))/bottom_y; // define the points for the base angle polygon base = [[indent,0],[bottom_x-indent,0],[bottom_x,indent], [bottom_x,bottom_y-indent],[bottom_x-indent,bottom_y], [indent,bottom_y],[0,bottom_y-indent],[0,indent]]; //define the size of the tab layer for referening cuts tab_x=(bottom_x+2*tab_depth*tan(draft_angle)); tab_y=(bottom_y+2*tab_depth*tan(draft_angle)); // how far to move stuff for the thinfoot bottom_offset = foot_depth-thinfoot_thickness; // add a little to each cut to make it render properly render_offset = 0.01; /******************************************************************************* * Main "program" to make the parts *******************************************************************************/ print_part(); /******************************************************************************* * This module is used by Makerbot Customizer to create different .stl * files for each part. *******************************************************************************/ module print_part(){ if(part ==0) make_foot(); else if (part == 1) make_foot(); } // end module print_part /******************************************************************************* * Module that makes the foot *******************************************************************************/ module make_foot(){ difference(){ // Make the general shape translate([0,0,total_depth/2]) linear_extrude(height=total_depth, center = true, convexity = 10, scale=[scalex,scaley]) translate([-bottom_x/2,-bottom_y/2])polygon(points = base); // Cut out recess for tabs translate([-tab_x/2,15+tab_cutout_y,3*tab_depth/2]) cube([tab_cutout_x*2,30,tab_depth],center=true); translate([tab_x/2,15+tab_cutout_y,3*tab_depth/2]) cube([tab_cutout_x*2,30,tab_depth],center=true); translate([-(tab_x/2-tab_cutout_x),tab_cutout_y,tab_depth]) rotate([0,0,135]) cube([30,30,total_depth-tab_depth+render_offset]); translate([(tab_x/2-tab_cutout_x),tab_cutout_y,tab_depth]) rotate([0,0,-45]) cube([30,30,total_depth-tab_depth+render_offset]); // Chamfer edges for better fit below tab translate([-tab_x/2,(tab_y-side_chamfer_len)/2,tab_depth]) rotate([0,45,0]) cube([chamfer,side_chamfer_len,chamfer],center=true); translate([tab_x/2,(tab_y-side_chamfer_len)/2,tab_depth]) rotate([0,45,0]) cube([chamfer,side_chamfer_len,chamfer],center=true); translate([(-tab_x)/2+indent,(tab_y)/2,tab_depth]) rotate([0,45,-45]) cube([chamfer*1.5,20,chamfer*1.5],center=true); translate([(tab_x)/2-indent,(tab_y)/2,tab_depth]) rotate([0,45,45]) cube([chamfer*1.5,20,chamfer*1.5],center=true); // Notch for part sticking below tab translate([-(tab_x/2-tab_cutout_x+notch_dia/2),(tab_y-notch_len)/2,tab_depth]) rotate([90,0,0]) cylinder(h=notch_len,d=notch_dia,center=true,$fn=25); translate([(tab_x/2-tab_cutout_x+notch_dia/2),(tab_y-notch_len)/2,tab_depth]) rotate([90,0,0]) cylinder(h=notch_len,d=notch_dia,center=true,$fn=25); // Notch out front for goober translate([-(tab_x/2-tab_cutout_x+notch_dia/2),(tab_y)/2,tab_depth]) sphere(r=3,$fn=25); translate([(tab_x/2-tab_cutout_x+notch_dia/2),(tab_y)/2,tab_depth]) sphere(r=3,$fn=25); translate([-(tab_x/2-tab_cutout_x+notch_dia/2)-top_chamfer,(tab_y)/2+top_chamfer,tab_depth+5]) rotate([0,0,45])cube([20,20,10],center=true); translate([(tab_x/2-tab_cutout_x+notch_dia/2)+top_chamfer,(tab_y)/2+top_chamfer,tab_depth+5]) rotate([0,0,45])cube([20,20,10],center=true); counter_pos = thickness ? bottom_offset:0; // drill holes and countersinks or counterbores for row 1 if(hole_num != 0) for(i=[-hole_pos:hole_spacing:hole_pos+render_offset]){ translate([i,hole_offset,total_depth/2])cylinder(d=hole_dia,h=total_depth+render_offset,center=true,$fn=25); if(hole_type == 0) //counter_bore translate([i,hole_offset,counter_depth/2+counter_pos])cylinder(d=counter_dia,h=counter_depth+render_offset,center=true,$fn=25); else translate([i,hole_offset,counter_depth/2+counter_pos])cylinder(d1=countersink_dia+hole_dia,d2=hole_dia,h=counter_depth+render_offset,center=true,$fn=25); }//end for // drill holes and countersinks or counterbores for row 2 if(hole_num2 != 0) for(i=[-hole_pos2:hole_spacing2:hole_pos2+render_offset]){ translate([i,-hole_offset,total_depth/2])cylinder(d=hole_dia,h=total_depth+render_offset,center=true,$fn=25); if(hole_type == 0) //counter_bore translate([i,-hole_offset,counter_depth/2+counter_pos])cylinder(d=counter_dia,h=counter_depth+render_offset,center=true,$fn=25); else translate([i,-hole_offset,counter_depth/2+counter_pos])cylinder(d1=countersink_dia+hole_dia,d2=hole_dia,h=counter_depth+render_offset,center=true,$fn=25); }//end for // if thin foot if(thickness==1) cube([200,100,2*(bottom_offset)],center=true); if(type == 1) // Right translate([-40,0,0])cube([100,100,100],center=true); else if(type ==2) // Left translate([40,0,0])cube([100,100,100],center=true); if(tape==1) translate([0,0,total_depth-tape_thickness/2+render_offset])cube([tape_length,tape_width,tape_thickness],center=true); } // end difference } // end module