|
| 1 | +use <overpass-extrabold.ttf>; |
| 2 | + |
| 3 | +NUM = 30; |
| 4 | + |
| 5 | +BASE_WALL_THICKNESS=2.6; |
| 6 | +SLOT_DEPTH=35.55; |
| 7 | +SLOT_WIDTH=2.35; |
| 8 | +SLOT_HEIGHT=8; |
| 9 | +SLOT_WALL=0.85; |
| 10 | + |
| 11 | +FUDGE=0.0001; |
| 12 | + |
| 13 | +SLOTS_WIDTH = NUM*SLOT_WIDTH + (NUM-1)*SLOT_WALL; |
| 14 | +BASE_WIDTH=SLOTS_WIDTH+4.92501*2; |
| 15 | +SLOTS_DEPTH = SLOT_DEPTH; |
| 16 | +BASE_DEPTH=SLOTS_DEPTH+4.72500*2; |
| 17 | + |
| 18 | +WITH_CUTOUT=false; |
| 19 | + |
| 20 | + |
| 21 | +difference() { |
| 22 | + union() { |
| 23 | + translate([0, BASE_DEPTH, 0.5]) rotate([180, 0, 0]) 3d_chamfer(BASE_WIDTH, BASE_DEPTH, 2.82843, BASE_WIDTH-1, BASE_DEPTH-1, 2.41421, 0.5); |
| 24 | + |
| 25 | + translate([0, 0, 0.5]) linear_extrude(height = 4.5) 2d_chamfer(BASE_WIDTH, BASE_DEPTH, sqrt(pow(2.82843, 2)/2)); |
| 26 | + |
| 27 | + translate([BASE_WALL_THICKNESS, BASE_WALL_THICKNESS, 0.5+4.5]) linear_extrude(height = 4.6) 2d_chamfer(BASE_WIDTH-2*BASE_WALL_THICKNESS, BASE_DEPTH-2*BASE_WALL_THICKNESS, sqrt(pow(2.74559, 2)/2)); |
| 28 | + translate([BASE_WALL_THICKNESS, BASE_WALL_THICKNESS, 5+4.6]) 3d_chamfer(BASE_WIDTH-2*BASE_WALL_THICKNESS, BASE_DEPTH-2*BASE_WALL_THICKNESS, 2.75, BASE_WIDTH-2*BASE_WALL_THICKNESS-0.8,BASE_DEPTH-2*BASE_WALL_THICKNESS-0.8, 2.41421, 0.4); |
| 29 | + }; |
| 30 | + slots(); |
| 31 | +}; |
| 32 | + |
| 33 | +module slots() { |
| 34 | + for(i = [0 : NUM-1]) { |
| 35 | + translate([4.92500+i*(SLOT_WIDTH+SLOT_WALL), 4.72500, 10-SLOT_HEIGHT]) slot(); |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +module slot() { |
| 40 | + if(WITH_CUTOUT) { |
| 41 | + union() { |
| 42 | + cube([SLOT_WIDTH, SLOT_DEPTH+2.125, SLOT_HEIGHT]); |
| 43 | + translate([0, SLOT_DEPTH+2.125, 0]) rotate([45, 0, 0]) cube([SLOT_WIDTH, 1, 1]); |
| 44 | + translate([0, SLOT_DEPTH+2.125, sqrt(2)/2]) cube([SLOT_WIDTH, sqrt(2)/2, SLOT_HEIGHT-sqrt(2)/2]); |
| 45 | + } |
| 46 | + } else { |
| 47 | + difference() { |
| 48 | + cube([SLOT_WIDTH, SLOT_DEPTH+2.125, SLOT_HEIGHT]); |
| 49 | + translate([0, SLOT_DEPTH+2.125, -sqrt(2)/2]) rotate([45, 0, 0]) cube([SLOT_WIDTH, 1, 1]); |
| 50 | + } |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +module 3d_chamfer(bottomW, bottomD, bottomSideChamfer, topW, topD, topSideChamfer, height) { |
| 58 | + hull() { |
| 59 | + linear_extrude(height = FUDGE) 2d_chamfer(bottomW, bottomD, sqrt(pow(bottomSideChamfer, 2)/2)); |
| 60 | + translate([(topW/bottomW)/2, (topD/bottomD)/2, height-FUDGE]) linear_extrude(height = FUDGE) 2d_chamfer(topW, topD, sqrt(pow(topSideChamfer, 2)/2)); |
| 61 | + } |
| 62 | +} |
| 63 | + |
| 64 | +module 2d_chamfer(bottomW, bottomD, radius) { |
| 65 | + polygon([ |
| 66 | + [radius, 0], |
| 67 | + [0, radius], |
| 68 | + [0, bottomD-radius], |
| 69 | + [radius, bottomD], |
| 70 | + [bottomW-radius, bottomD], |
| 71 | + [bottomW, bottomD-radius], |
| 72 | + [bottomW, radius], |
| 73 | + [bottomW-radius, 0] |
| 74 | + ]); |
| 75 | +} |
| 76 | + |
| 77 | + |
0 commit comments