paul@0 | 1 | module cartridge() |
paul@0 | 2 | { |
paul@0 | 3 | $fn = 50; |
paul@0 | 4 | |
paul@3 | 5 | /* Rounding/fillet radius and additional margin of subtracted |
paul@3 | 6 | material. The additional margin helps avoid geometry |
paul@3 | 7 | problems. */ |
paul@3 | 8 | |
paul@3 | 9 | rr = 1; |
paul@3 | 10 | ro = rr; |
paul@3 | 11 | extra = 0.1; |
paul@3 | 12 | |
paul@0 | 13 | module fillet(r, h) { |
paul@0 | 14 | translate([0, 0, -h/2]) |
paul@0 | 15 | difference() { |
paul@3 | 16 | cube([r + extra, r + extra, h]); |
paul@0 | 17 | cylinder(r = r, h = h); |
paul@0 | 18 | } |
paul@0 | 19 | } |
paul@0 | 20 | |
paul@0 | 21 | /* Cartridge dimensions. */ |
paul@0 | 22 | |
paul@0 | 23 | width = 89.0; |
paul@0 | 24 | height = 68.5; |
paul@0 | 25 | depth = 16.5; |
paul@0 | 26 | |
paul@1 | 27 | /* Details. */ |
paul@1 | 28 | |
paul@1 | 29 | front_label_width = 83.0; |
paul@1 | 30 | front_label_height = 46.0; |
paul@1 | 31 | front_label_depth = 1.0; |
paul@1 | 32 | front_label_offset_from_bottom = 19.5; |
paul@3 | 33 | |
paul@1 | 34 | top_label_width = front_label_width; |
paul@1 | 35 | top_label_height = 11.5; |
paul@1 | 36 | top_label_depth = front_label_depth; |
paul@1 | 37 | top_label_offset_from_front = 2.5; |
paul@3 | 38 | |
paul@2 | 39 | groove_depth = 1.0; |
paul@1 | 40 | |
paul@0 | 41 | /* Side thicknesses. */ |
paul@0 | 42 | |
paul@0 | 43 | front = 2; |
paul@0 | 44 | back = 3.5; |
paul@0 | 45 | top = 3; |
paul@0 | 46 | left = 2; |
paul@0 | 47 | right = 2; |
paul@0 | 48 | |
paul@0 | 49 | difference() { |
paul@1 | 50 | |
paul@1 | 51 | /* The cartridge surfaces. */ |
paul@1 | 52 | |
paul@0 | 53 | union() { |
paul@0 | 54 | translate([0, -depth / 2 + front / 2, 0]) |
paul@0 | 55 | cube([width, front, height], center = true); |
paul@0 | 56 | translate([0, depth / 2 - back / 2, 0]) |
paul@0 | 57 | cube([width, back, height], center = true); |
paul@0 | 58 | translate([-width / 2 + left / 2, 0, 0]) |
paul@0 | 59 | cube([left, depth, height], center = true); |
paul@0 | 60 | translate([width / 2 - right / 2, 0, 0]) |
paul@0 | 61 | cube([right, depth, height], center = true); |
paul@0 | 62 | translate([0, 0, height / 2 - top / 2]) |
paul@0 | 63 | cube([width, depth, top], center = true); |
paul@0 | 64 | } |
paul@0 | 65 | |
paul@1 | 66 | /* Label insets. */ |
paul@1 | 67 | |
paul@1 | 68 | union() { |
paul@1 | 69 | |
paul@1 | 70 | /* Front label. */ |
paul@1 | 71 | |
paul@1 | 72 | translate([-front_label_width / 2, -depth / 2, |
paul@1 | 73 | front_label_offset_from_bottom - height / 2]) |
paul@1 | 74 | cube([front_label_width, front_label_depth, |
paul@1 | 75 | front_label_height]); |
paul@1 | 76 | |
paul@1 | 77 | /* Top label. */ |
paul@1 | 78 | |
paul@1 | 79 | translate([-top_label_width / 2, |
paul@1 | 80 | -depth / 2 + top_label_offset_from_front, |
paul@1 | 81 | height / 2 - top_label_depth]) |
paul@1 | 82 | cube([top_label_width, top_label_height, |
paul@1 | 83 | top_label_depth]); |
paul@1 | 84 | } |
paul@1 | 85 | |
paul@2 | 86 | /* Top and side grooves. */ |
paul@2 | 87 | |
paul@2 | 88 | union() { |
paul@2 | 89 | |
paul@2 | 90 | /* Left groove. */ |
paul@2 | 91 | |
paul@2 | 92 | translate([-width / 2 + groove_depth / 2, 0, 0]) |
paul@2 | 93 | cube([groove_depth, groove_depth, height], center = true); |
paul@2 | 94 | |
paul@2 | 95 | /* Right groove. */ |
paul@2 | 96 | |
paul@2 | 97 | translate([width / 2 - groove_depth / 2, 0, 0]) |
paul@2 | 98 | cube([groove_depth, groove_depth, height], center = true); |
paul@2 | 99 | |
paul@2 | 100 | /* Top groove. */ |
paul@2 | 101 | |
paul@2 | 102 | translate([0, 0, height / 2 - groove_depth / 2]) |
paul@2 | 103 | cube([width, groove_depth, groove_depth], center = true); |
paul@2 | 104 | } |
paul@2 | 105 | |
paul@1 | 106 | /* Fillets to round off the edges. */ |
paul@1 | 107 | |
paul@0 | 108 | union() { |
paul@0 | 109 | |
paul@0 | 110 | /* Top left and right rounding. */ |
paul@0 | 111 | |
paul@0 | 112 | translate([-width / 2 + ro, 0, height / 2 - ro]) |
paul@0 | 113 | rotate([0, 0, 180]) |
paul@0 | 114 | rotate([90, 0, 0]) |
paul@3 | 115 | fillet(rr, depth); |
paul@0 | 116 | translate([width / 2 - ro, 0, height / 2 - ro]) |
paul@0 | 117 | rotate([90, 0, 0]) |
paul@3 | 118 | fillet(rr, depth); |
paul@0 | 119 | |
paul@0 | 120 | /* Top back and front rounding. */ |
paul@0 | 121 | |
paul@0 | 122 | translate([0, depth / 2 - ro, height / 2 - ro]) |
paul@0 | 123 | rotate([0, -90, 0]) |
paul@3 | 124 | fillet(rr, width); |
paul@0 | 125 | translate([0, -depth / 2 + ro, height / 2 - ro]) |
paul@0 | 126 | rotate([0, 0, 180]) |
paul@0 | 127 | rotate([0, -90, 0]) |
paul@3 | 128 | fillet(rr, width); |
paul@0 | 129 | |
paul@0 | 130 | /* Edge rounding. */ |
paul@0 | 131 | |
paul@0 | 132 | translate([width / 2 - ro, depth / 2 - ro, 0]) |
paul@3 | 133 | fillet(rr, height); |
paul@0 | 134 | translate([-width / 2 + ro, depth / 2 - ro, 0]) |
paul@0 | 135 | rotate([0, 0, 90]) |
paul@3 | 136 | fillet(rr, height); |
paul@0 | 137 | translate([-width / 2 + ro, -depth / 2 + ro, 0]) |
paul@0 | 138 | rotate([0, 0, 180]) |
paul@3 | 139 | fillet(rr, height); |
paul@0 | 140 | translate([width / 2 - ro, -depth / 2 + ro, 0]) |
paul@0 | 141 | rotate([0, 0, 270]) |
paul@3 | 142 | fillet(rr, height); |
paul@0 | 143 | } |
paul@0 | 144 | } |
paul@0 | 145 | } |
paul@0 | 146 | |
paul@0 | 147 | cartridge(); |
paul@0 | 148 | |