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@8 | 26 | front_depth = 6.5; |
paul@8 | 27 | back_depth = 11.0; |
paul@0 | 28 | |
paul@1 | 29 | /* Details. */ |
paul@1 | 30 | |
paul@1 | 31 | front_label_width = 83.0; |
paul@1 | 32 | front_label_height = 46.0; |
paul@1 | 33 | front_label_depth = 1.0; |
paul@1 | 34 | front_label_offset_from_bottom = 19.5; |
paul@3 | 35 | |
paul@1 | 36 | top_label_width = front_label_width; |
paul@1 | 37 | top_label_height = 11.5; |
paul@1 | 38 | top_label_depth = front_label_depth; |
paul@1 | 39 | top_label_offset_from_front = 2.5; |
paul@3 | 40 | |
paul@8 | 41 | groove_width = 2.5; /* how much the groove cuts out of the back */ |
paul@8 | 42 | groove_depth = 1.0; /* how deep the groove goes into each side */ |
paul@8 | 43 | top_groove_width = 1.0; |
paul@8 | 44 | top_groove_depth = 2.0; |
paul@1 | 45 | |
paul@4 | 46 | back_cavity_width = 68.0; |
paul@4 | 47 | back_cavity_inner_width = 65.0; |
paul@4 | 48 | back_cavity_offset_from_left = 10.5; |
paul@4 | 49 | back_cavity_inner_offset_from_left = 12.0; |
paul@4 | 50 | back_cavity_height = 13.5; |
paul@4 | 51 | back_cavity_inner_height = 12.0; |
paul@4 | 52 | back_cavity_depth = 1.5; |
paul@4 | 53 | |
paul@6 | 54 | inner_back_cavity_offset = 1.0; |
paul@5 | 55 | inner_back_cavity_offset_from_left = 2.0; |
paul@5 | 56 | inner_back_slope_offset_from_left = 10.0; |
paul@5 | 57 | inner_back_slope_width = 2.5; |
paul@6 | 58 | inner_back_slope_depth = 2.5; |
paul@5 | 59 | |
paul@5 | 60 | inner_back_edge_offset = 2.0; |
paul@5 | 61 | inner_back_edge_width = 69.0; |
paul@5 | 62 | inner_back_edge_height = 3.0; |
paul@5 | 63 | inner_back_edge_depth = 1.5; |
paul@5 | 64 | |
paul@7 | 65 | inner_front_edge_offset = 0.5; |
paul@7 | 66 | inner_front_edge_width = 87.0; |
paul@7 | 67 | inner_front_edge_height = 3.0; |
paul@7 | 68 | inner_front_edge_depth = 1.5; |
paul@7 | 69 | |
paul@5 | 70 | bottom_from_base = 13.5; |
paul@5 | 71 | |
paul@8 | 72 | edge_connector_cutout_front_offset = 1.0; |
paul@8 | 73 | edge_connector_cutout_front_depth = 1.0; |
paul@8 | 74 | edge_connector_cutout_front_width = 15.0; |
paul@8 | 75 | edge_connector_cutout_back_depth = 3.0; |
paul@8 | 76 | edge_connector_cutout_back_width = 57.0; |
paul@8 | 77 | |
paul@0 | 78 | /* Side thicknesses. */ |
paul@0 | 79 | |
paul@0 | 80 | front = 2; |
paul@0 | 81 | back = 3.5; |
paul@0 | 82 | top = 3; |
paul@8 | 83 | front_left = 1; |
paul@8 | 84 | front_right = 1; |
paul@8 | 85 | back_left = 2; |
paul@8 | 86 | back_right = 2; |
paul@5 | 87 | bottom = 2; |
paul@0 | 88 | |
paul@0 | 89 | difference() { |
paul@1 | 90 | |
paul@1 | 91 | /* The cartridge surfaces. */ |
paul@1 | 92 | |
paul@0 | 93 | union() { |
paul@8 | 94 | |
paul@8 | 95 | /* Front portion. */ |
paul@8 | 96 | |
paul@8 | 97 | translate([0, -front_depth + front / 2, 0]) |
paul@0 | 98 | cube([width, front, height], center = true); |
paul@8 | 99 | translate([-width / 2 + front_left / 2, -front_depth / 2, 0]) |
paul@8 | 100 | cube([front_left, front_depth, height], center = true); |
paul@8 | 101 | translate([width / 2 - front_right / 2, -front_depth / 2, 0]) |
paul@8 | 102 | cube([front_right, front_depth, height], center = true); |
paul@8 | 103 | translate([0, -front_depth / 2, height / 2 - top / 2]) |
paul@8 | 104 | cube([width, front_depth, top], center = true); |
paul@8 | 105 | difference() { |
paul@8 | 106 | translate([0, -front_depth / 2, |
paul@8 | 107 | -height / 2 + bottom / 2 + bottom_from_base]) |
paul@8 | 108 | cube([width, front_depth, bottom], center = true); |
paul@8 | 109 | translate([-width / 2 + edge_connector_cutout_front_offset + |
paul@8 | 110 | edge_connector_cutout_front_width / 2, |
paul@8 | 111 | -edge_connector_cutout_front_depth / 2, |
paul@8 | 112 | -height / 2 + bottom / 2 + bottom_from_base]) |
paul@8 | 113 | cube([edge_connector_cutout_front_width, |
paul@8 | 114 | edge_connector_cutout_front_depth, |
paul@8 | 115 | bottom + extra], center = true); |
paul@8 | 116 | translate([width / 2 - edge_connector_cutout_front_offset - |
paul@8 | 117 | edge_connector_cutout_front_width / 2, |
paul@8 | 118 | -edge_connector_cutout_front_depth / 2, |
paul@8 | 119 | -height / 2 + bottom / 2 + bottom_from_base]) |
paul@8 | 120 | cube([edge_connector_cutout_front_width, |
paul@8 | 121 | edge_connector_cutout_front_depth, |
paul@8 | 122 | bottom + extra], center = true); |
paul@8 | 123 | } |
paul@8 | 124 | |
paul@8 | 125 | /* Back portion. */ |
paul@8 | 126 | |
paul@8 | 127 | translate([0, back_depth - back / 2, 0]) |
paul@0 | 128 | cube([width, back, height], center = true); |
paul@8 | 129 | translate([-width / 2 + back_left / 2, back_depth / 2, 0]) |
paul@8 | 130 | cube([back_left, back_depth, height], center = true); |
paul@8 | 131 | translate([width / 2 - back_right / 2, back_depth / 2, 0]) |
paul@8 | 132 | cube([back_right, back_depth, height], center = true); |
paul@8 | 133 | translate([0, back_depth / 2, height / 2 - top / 2]) |
paul@8 | 134 | cube([width, back_depth, top], center = true); |
paul@8 | 135 | difference() { |
paul@8 | 136 | translate([0, back_depth / 2, |
paul@8 | 137 | -height / 2 + bottom / 2 + bottom_from_base]) |
paul@8 | 138 | cube([width, back_depth, bottom], center = true); |
paul@8 | 139 | translate([0, edge_connector_cutout_back_depth / 2, |
paul@8 | 140 | -height / 2 + bottom / 2 + bottom_from_base]) |
paul@8 | 141 | cube([edge_connector_cutout_back_width, |
paul@8 | 142 | edge_connector_cutout_back_depth, |
paul@8 | 143 | bottom + extra], center = true); |
paul@8 | 144 | } |
paul@0 | 145 | } |
paul@0 | 146 | |
paul@1 | 147 | /* Label insets. */ |
paul@1 | 148 | |
paul@1 | 149 | union() { |
paul@1 | 150 | |
paul@1 | 151 | /* Front label. */ |
paul@1 | 152 | |
paul@8 | 153 | translate([-front_label_width / 2, -front_depth, |
paul@1 | 154 | front_label_offset_from_bottom - height / 2]) |
paul@1 | 155 | cube([front_label_width, front_label_depth, |
paul@1 | 156 | front_label_height]); |
paul@1 | 157 | |
paul@1 | 158 | /* Top label. */ |
paul@1 | 159 | |
paul@1 | 160 | translate([-top_label_width / 2, |
paul@8 | 161 | -front_depth + top_label_offset_from_front, |
paul@1 | 162 | height / 2 - top_label_depth]) |
paul@1 | 163 | cube([top_label_width, top_label_height, |
paul@1 | 164 | top_label_depth]); |
paul@1 | 165 | } |
paul@1 | 166 | |
paul@8 | 167 | /* Top and side grooves, positioned in the back portion. */ |
paul@2 | 168 | |
paul@2 | 169 | union() { |
paul@2 | 170 | |
paul@2 | 171 | /* Left groove. */ |
paul@2 | 172 | |
paul@8 | 173 | translate([-width / 2 + groove_depth / 2, groove_width / 2, 0]) |
paul@8 | 174 | cube([groove_depth, groove_width, height], |
paul@4 | 175 | center = true); |
paul@2 | 176 | |
paul@2 | 177 | /* Right groove. */ |
paul@2 | 178 | |
paul@8 | 179 | translate([width / 2 - groove_depth / 2, groove_width / 2, 0]) |
paul@8 | 180 | cube([groove_depth, groove_width, height], |
paul@4 | 181 | center = true); |
paul@2 | 182 | |
paul@8 | 183 | /* Top grooves. */ |
paul@2 | 184 | |
paul@8 | 185 | translate([0, groove_width / 2, height / 2 - groove_depth / 2]) |
paul@8 | 186 | cube([width, groove_width, groove_depth], |
paul@8 | 187 | center = true); |
paul@8 | 188 | |
paul@8 | 189 | translate([0, top_groove_width / 2, |
paul@8 | 190 | height / 2 - top_groove_depth / 2]) |
paul@8 | 191 | cube([width, top_groove_width, top_groove_depth], |
paul@4 | 192 | center = true); |
paul@4 | 193 | } |
paul@4 | 194 | |
paul@4 | 195 | /* Back cavity. */ |
paul@4 | 196 | |
paul@4 | 197 | intersection() { |
paul@4 | 198 | |
paul@4 | 199 | /* From the bottom upwards. */ |
paul@4 | 200 | |
paul@8 | 201 | translate([0, back_depth, -height / 2]) |
paul@4 | 202 | linear_extrude(height = back_cavity_height) |
paul@4 | 203 | translate([-width / 2, 0, 0]) |
paul@4 | 204 | polygon([ |
paul@4 | 205 | [back_cavity_offset_from_left, 0], |
paul@4 | 206 | [back_cavity_inner_offset_from_left, |
paul@4 | 207 | -back_cavity_depth], |
paul@4 | 208 | [back_cavity_inner_offset_from_left + |
paul@4 | 209 | back_cavity_inner_width, |
paul@4 | 210 | -back_cavity_depth], |
paul@4 | 211 | [back_cavity_offset_from_left + |
paul@4 | 212 | back_cavity_width, 0] |
paul@4 | 213 | ]); |
paul@4 | 214 | |
paul@4 | 215 | /* From left to right. */ |
paul@4 | 216 | |
paul@8 | 217 | translate([back_cavity_width / 2, back_depth, -height / 2]) |
paul@4 | 218 | rotate([0, -90, 0]) |
paul@4 | 219 | linear_extrude(height = back_cavity_width) |
paul@4 | 220 | polygon([ |
paul@4 | 221 | [-extra, -back_cavity_depth], |
paul@4 | 222 | [back_cavity_inner_height, |
paul@4 | 223 | -back_cavity_depth], |
paul@4 | 224 | [back_cavity_height, 0], |
paul@4 | 225 | [-extra, 0] |
paul@4 | 226 | ]); |
paul@2 | 227 | } |
paul@2 | 228 | |
paul@5 | 229 | /* Inner back cavities. */ |
paul@5 | 230 | |
paul@8 | 231 | translate([0, back_depth - inner_back_cavity_offset, -height / 2]) |
paul@5 | 232 | linear_extrude(height = bottom_from_base) |
paul@5 | 233 | translate([-width / 2, 0, 0]) |
paul@5 | 234 | polygon([ |
paul@5 | 235 | [inner_back_cavity_offset_from_left, 0], |
paul@5 | 236 | [inner_back_slope_offset_from_left, 0], |
paul@5 | 237 | [inner_back_slope_offset_from_left + |
paul@5 | 238 | inner_back_slope_width, |
paul@5 | 239 | -inner_back_slope_depth], |
paul@5 | 240 | [inner_back_cavity_offset_from_left, |
paul@5 | 241 | -inner_back_slope_depth] |
paul@5 | 242 | ]); |
paul@5 | 243 | |
paul@8 | 244 | translate([0, back_depth - inner_back_cavity_offset, -height / 2]) |
paul@5 | 245 | linear_extrude(height = bottom_from_base) |
paul@5 | 246 | translate([-width / 2, 0, 0]) |
paul@5 | 247 | polygon([ |
paul@5 | 248 | [width - inner_back_slope_offset_from_left, 0], |
paul@5 | 249 | [width - inner_back_cavity_offset_from_left, 0], |
paul@5 | 250 | [width - inner_back_cavity_offset_from_left, |
paul@5 | 251 | -inner_back_slope_depth], |
paul@5 | 252 | [width - inner_back_slope_offset_from_left - |
paul@5 | 253 | inner_back_slope_width, |
paul@5 | 254 | -inner_back_slope_depth] |
paul@5 | 255 | ]); |
paul@5 | 256 | |
paul@7 | 257 | /* Inner back edge cavity. */ |
paul@7 | 258 | |
paul@5 | 259 | translate([inner_back_edge_width / 2, |
paul@8 | 260 | back_depth - inner_back_edge_offset, -height / 2]) |
paul@5 | 261 | rotate([0, -90, 0]) |
paul@5 | 262 | linear_extrude(height = inner_back_edge_width) |
paul@5 | 263 | polygon([ |
paul@5 | 264 | [-extra, -inner_back_edge_depth], |
paul@5 | 265 | [inner_back_edge_height, -inner_back_edge_depth], |
paul@5 | 266 | [0, 0], |
paul@5 | 267 | [-extra, 0] |
paul@5 | 268 | ]); |
paul@5 | 269 | |
paul@7 | 270 | /* Inner front edge cavity. */ |
paul@7 | 271 | |
paul@7 | 272 | translate([inner_front_edge_width / 2, |
paul@8 | 273 | -front_depth + inner_front_edge_offset, -height / 2]) |
paul@7 | 274 | rotate([0, -90, 0]) |
paul@7 | 275 | linear_extrude(height = inner_front_edge_width) |
paul@7 | 276 | polygon([ |
paul@7 | 277 | [-extra, 0], |
paul@7 | 278 | [0, 0], |
paul@7 | 279 | [inner_front_edge_height, inner_front_edge_depth], |
paul@7 | 280 | [-extra, inner_front_edge_depth], |
paul@7 | 281 | ]); |
paul@7 | 282 | |
paul@1 | 283 | /* Fillets to round off the edges. */ |
paul@1 | 284 | |
paul@0 | 285 | union() { |
paul@0 | 286 | |
paul@0 | 287 | /* Top left and right rounding. */ |
paul@0 | 288 | |
paul@0 | 289 | translate([-width / 2 + ro, 0, height / 2 - ro]) |
paul@0 | 290 | rotate([0, 0, 180]) |
paul@0 | 291 | rotate([90, 0, 0]) |
paul@3 | 292 | fillet(rr, depth); |
paul@0 | 293 | translate([width / 2 - ro, 0, height / 2 - ro]) |
paul@0 | 294 | rotate([90, 0, 0]) |
paul@3 | 295 | fillet(rr, depth); |
paul@0 | 296 | |
paul@0 | 297 | /* Top back and front rounding. */ |
paul@0 | 298 | |
paul@8 | 299 | translate([0, back_depth - ro, height / 2 - ro]) |
paul@0 | 300 | rotate([0, -90, 0]) |
paul@3 | 301 | fillet(rr, width); |
paul@8 | 302 | translate([0, -front_depth + ro, height / 2 - ro]) |
paul@0 | 303 | rotate([0, 0, 180]) |
paul@0 | 304 | rotate([0, -90, 0]) |
paul@3 | 305 | fillet(rr, width); |
paul@0 | 306 | |
paul@0 | 307 | /* Edge rounding. */ |
paul@0 | 308 | |
paul@8 | 309 | translate([width / 2 - ro, back_depth - ro, 0]) |
paul@3 | 310 | fillet(rr, height); |
paul@8 | 311 | translate([-width / 2 + ro, back_depth - ro, 0]) |
paul@0 | 312 | rotate([0, 0, 90]) |
paul@3 | 313 | fillet(rr, height); |
paul@8 | 314 | translate([-width / 2 + ro, -front_depth + ro, 0]) |
paul@0 | 315 | rotate([0, 0, 180]) |
paul@3 | 316 | fillet(rr, height); |
paul@8 | 317 | translate([width / 2 - ro, -front_depth + ro, 0]) |
paul@0 | 318 | rotate([0, 0, 270]) |
paul@3 | 319 | fillet(rr, height); |
paul@0 | 320 | } |
paul@0 | 321 | } |
paul@0 | 322 | } |
paul@0 | 323 | |
paul@0 | 324 | cartridge(); |
paul@0 | 325 | |