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@12 | 16 | cube([r + extra, r + extra, h + extra]); |
paul@0 | 17 | cylinder(r = r, h = h); |
paul@0 | 18 | } |
paul@0 | 19 | } |
paul@0 | 20 | |
paul@20 | 21 | /* |
paul@20 | 22 | Make a cuboid of the given dimensions, justifying it according to the given |
paul@20 | 23 | factors (where 1 indicates moving the cuboid to the positive side of the |
paul@20 | 24 | axis, and -1 indicates moving it to the negative side of the axis), and |
paul@20 | 25 | moving it to the specified coordinates. |
paul@20 | 26 | */ |
paul@20 | 27 | module cube_at(width, depth, height, wdir, ddir, hdir, x, y, z) { |
paul@20 | 28 | translate([ |
paul@20 | 29 | x + wdir * width / 2, |
paul@20 | 30 | y + ddir * depth / 2, |
paul@20 | 31 | z + hdir * height / 2]) |
paul@20 | 32 | cube([width, depth, height], center = true); |
paul@20 | 33 | } |
paul@20 | 34 | |
paul@0 | 35 | /* Cartridge dimensions. */ |
paul@0 | 36 | |
paul@0 | 37 | width = 89.0; |
paul@0 | 38 | height = 68.5; |
paul@0 | 39 | depth = 16.5; |
paul@8 | 40 | front_depth = 6.5; |
paul@8 | 41 | back_depth = 11.0; |
paul@0 | 42 | |
paul@20 | 43 | /* Label details. */ |
paul@1 | 44 | |
paul@1 | 45 | front_label_width = 83.0; |
paul@1 | 46 | front_label_height = 46.0; |
paul@1 | 47 | front_label_depth = 1.0; |
paul@1 | 48 | front_label_offset_from_bottom = 19.5; |
paul@3 | 49 | |
paul@1 | 50 | top_label_width = front_label_width; |
paul@20 | 51 | top_label_height = 11.5; /* the height as seen from above */ |
paul@1 | 52 | top_label_depth = front_label_depth; |
paul@1 | 53 | top_label_offset_from_front = 2.5; |
paul@3 | 54 | |
paul@20 | 55 | /* The groove around the sides and top. */ |
paul@20 | 56 | |
paul@8 | 57 | groove_width = 2.5; /* how much the groove cuts out of the back */ |
paul@8 | 58 | groove_depth = 1.0; /* how deep the groove goes into each side */ |
paul@20 | 59 | |
paul@20 | 60 | /* Additional cutting to mate the back and front. */ |
paul@20 | 61 | |
paul@8 | 62 | top_groove_width = 1.0; |
paul@8 | 63 | top_groove_depth = 2.0; |
paul@20 | 64 | |
paul@20 | 65 | /* Space for the back inside the front. */ |
paul@20 | 66 | |
paul@9 | 67 | inner_top_front_cutout_width = 87.0; |
paul@9 | 68 | inner_top_front_cutout_depth = 1.0; |
paul@9 | 69 | inner_top_front_cutout_offset = 2.0; |
paul@1 | 70 | |
paul@4 | 71 | back_cavity_width = 68.0; |
paul@4 | 72 | back_cavity_inner_width = 65.0; |
paul@4 | 73 | back_cavity_offset_from_left = 10.5; |
paul@4 | 74 | back_cavity_inner_offset_from_left = 12.0; |
paul@4 | 75 | back_cavity_height = 13.5; |
paul@4 | 76 | back_cavity_inner_height = 12.0; |
paul@4 | 77 | back_cavity_depth = 1.5; |
paul@4 | 78 | |
paul@6 | 79 | inner_back_cavity_offset = 1.0; |
paul@5 | 80 | inner_back_cavity_offset_from_left = 2.0; |
paul@5 | 81 | inner_back_slope_offset_from_left = 10.0; |
paul@5 | 82 | inner_back_slope_width = 2.5; |
paul@6 | 83 | inner_back_slope_depth = 2.5; |
paul@5 | 84 | |
paul@5 | 85 | inner_back_edge_offset = 2.0; |
paul@5 | 86 | inner_back_edge_width = 69.0; |
paul@5 | 87 | inner_back_edge_height = 3.0; |
paul@5 | 88 | inner_back_edge_depth = 1.5; |
paul@5 | 89 | |
paul@7 | 90 | inner_front_edge_offset = 0.5; |
paul@7 | 91 | inner_front_edge_width = 87.0; |
paul@7 | 92 | inner_front_edge_height = 3.0; |
paul@7 | 93 | inner_front_edge_depth = 1.5; |
paul@7 | 94 | |
paul@5 | 95 | bottom_from_base = 13.5; |
paul@5 | 96 | |
paul@8 | 97 | edge_connector_cutout_front_offset = 1.0; |
paul@8 | 98 | edge_connector_cutout_front_depth = 1.0; |
paul@8 | 99 | edge_connector_cutout_front_width = 15.0; |
paul@8 | 100 | edge_connector_cutout_back_depth = 3.0; |
paul@8 | 101 | edge_connector_cutout_back_width = 57.0; |
paul@8 | 102 | |
paul@17 | 103 | /* |
paul@17 | 104 | Edge connectors are themselves 0.05" or approximately 1.27mm in |
paul@17 | 105 | thickness according to the Acorn Electron Cartridge Interface Specification |
paul@17 | 106 | (Acorn Support Application Group Note 014). |
paul@17 | 107 | */ |
paul@17 | 108 | |
paul@0 | 109 | /* Side thicknesses. */ |
paul@0 | 110 | |
paul@0 | 111 | front = 2; |
paul@0 | 112 | back = 3.5; |
paul@0 | 113 | top = 3; |
paul@8 | 114 | front_left = 1; |
paul@8 | 115 | front_right = 1; |
paul@8 | 116 | back_left = 2; |
paul@8 | 117 | back_right = 2; |
paul@5 | 118 | bottom = 2; |
paul@0 | 119 | |
paul@14 | 120 | /* Extra internal features. */ |
paul@14 | 121 | |
paul@14 | 122 | pcb_back_support_width = 1.0; |
paul@14 | 123 | pcb_back_support_depth = back_depth - |
paul@14 | 124 | edge_connector_cutout_back_depth; |
paul@14 | 125 | pcb_back_support_height = height - bottom_from_base - top - bottom; |
paul@14 | 126 | |
paul@15 | 127 | pcb_front_support_width = 1.0; |
paul@15 | 128 | pcb_front_support_depth = front_depth; |
paul@15 | 129 | pcb_front_support_height = pcb_back_support_height; |
paul@15 | 130 | |
paul@16 | 131 | /* |
paul@16 | 132 | Features measured from the Stardot Advanced Battery Backed RAM |
paul@16 | 133 | cartridge board dimensional diagram. |
paul@16 | 134 | */ |
paul@16 | 135 | |
paul@16 | 136 | pcb_back_support_bump_width = pcb_front_support_width; |
paul@18 | 137 | pcb_back_support_bump_depth = 1.5; |
paul@17 | 138 | pcb_back_support_left_bump_height = 14.3; |
paul@17 | 139 | pcb_back_support_right_bump_height = 11.7; |
paul@18 | 140 | pcb_back_support_left_bump_offset_from_bottom = 26.0 - 11.8; |
paul@18 | 141 | pcb_back_support_right_bump_offset_from_bottom = 28.6 - 11.8; |
paul@16 | 142 | |
paul@19 | 143 | translate([-width * 0.6, 0, 0]) |
paul@0 | 144 | difference() { |
paul@1 | 145 | |
paul@1 | 146 | /* The cartridge surfaces. */ |
paul@1 | 147 | |
paul@0 | 148 | union() { |
paul@8 | 149 | |
paul@8 | 150 | /* Front portion. */ |
paul@8 | 151 | |
paul@8 | 152 | translate([0, -front_depth + front / 2, 0]) |
paul@0 | 153 | cube([width, front, height], center = true); |
paul@8 | 154 | translate([-width / 2 + front_left / 2, -front_depth / 2, 0]) |
paul@8 | 155 | cube([front_left, front_depth, height], center = true); |
paul@8 | 156 | translate([width / 2 - front_right / 2, -front_depth / 2, 0]) |
paul@8 | 157 | cube([front_right, front_depth, height], center = true); |
paul@8 | 158 | translate([0, -front_depth / 2, height / 2 - top / 2]) |
paul@8 | 159 | cube([width, front_depth, top], center = true); |
paul@8 | 160 | difference() { |
paul@20 | 161 | |
paul@20 | 162 | /* Floor of cartridge. */ |
paul@20 | 163 | |
paul@20 | 164 | cube_at(width, front_depth, bottom, |
paul@20 | 165 | 0, -1, 1, |
paul@20 | 166 | 0, 0, -height / 2 + bottom_from_base); |
paul@20 | 167 | |
paul@20 | 168 | /* Left cutout. */ |
paul@20 | 169 | |
paul@20 | 170 | cube_at(edge_connector_cutout_front_width, |
paul@20 | 171 | edge_connector_cutout_front_depth, |
paul@20 | 172 | bottom, |
paul@20 | 173 | 1, -1, 1, |
paul@20 | 174 | -width / 2 + edge_connector_cutout_front_offset, |
paul@20 | 175 | 0, |
paul@20 | 176 | -height / 2 + bottom_from_base); |
paul@20 | 177 | |
paul@20 | 178 | /* Right cutout. */ |
paul@20 | 179 | |
paul@20 | 180 | cube_at(edge_connector_cutout_front_width, |
paul@20 | 181 | edge_connector_cutout_front_depth, |
paul@20 | 182 | bottom, |
paul@20 | 183 | -1, -1, 1, |
paul@20 | 184 | width / 2 - edge_connector_cutout_front_offset, |
paul@20 | 185 | 0, |
paul@20 | 186 | -height / 2 + bottom_from_base); |
paul@8 | 187 | } |
paul@15 | 188 | |
paul@15 | 189 | /* PCB supports. */ |
paul@15 | 190 | |
paul@20 | 191 | cube_at(pcb_front_support_width, |
paul@20 | 192 | pcb_front_support_depth, |
paul@20 | 193 | pcb_front_support_height, |
paul@20 | 194 | 1, -1, 1, |
paul@20 | 195 | -edge_connector_cutout_back_width / 2, |
paul@20 | 196 | 0, |
paul@20 | 197 | -height / 2 + bottom + bottom_from_base); |
paul@15 | 198 | |
paul@20 | 199 | cube_at(pcb_front_support_width, |
paul@20 | 200 | pcb_front_support_depth, |
paul@20 | 201 | pcb_front_support_height, |
paul@20 | 202 | -1, -1, 1, |
paul@20 | 203 | edge_connector_cutout_back_width / 2, |
paul@20 | 204 | 0, |
paul@20 | 205 | -height / 2 + bottom + bottom_from_base); |
paul@10 | 206 | } |
paul@10 | 207 | |
paul@10 | 208 | /* Label insets. */ |
paul@10 | 209 | |
paul@10 | 210 | union() { |
paul@10 | 211 | |
paul@10 | 212 | /* Front label. */ |
paul@10 | 213 | |
paul@10 | 214 | translate([-front_label_width / 2, -front_depth, |
paul@10 | 215 | front_label_offset_from_bottom - height / 2]) |
paul@10 | 216 | cube([front_label_width, front_label_depth, |
paul@10 | 217 | front_label_height]); |
paul@10 | 218 | |
paul@10 | 219 | /* Top label. */ |
paul@10 | 220 | |
paul@10 | 221 | translate([-top_label_width / 2, |
paul@10 | 222 | -front_depth + top_label_offset_from_front, |
paul@10 | 223 | height / 2 - top_label_depth]) |
paul@10 | 224 | cube([top_label_width, top_label_height, |
paul@10 | 225 | top_label_depth]); |
paul@10 | 226 | } |
paul@10 | 227 | |
paul@10 | 228 | /* Inner front edge cavity. */ |
paul@10 | 229 | |
paul@10 | 230 | translate([inner_front_edge_width / 2, |
paul@10 | 231 | -front_depth + inner_front_edge_offset, -height / 2]) |
paul@10 | 232 | rotate([0, -90, 0]) |
paul@10 | 233 | linear_extrude(height = inner_front_edge_width) |
paul@10 | 234 | polygon([ |
paul@10 | 235 | [-extra, 0], |
paul@10 | 236 | [0, 0], |
paul@10 | 237 | [inner_front_edge_height, inner_front_edge_depth], |
paul@10 | 238 | [-extra, inner_front_edge_depth], |
paul@10 | 239 | ]); |
paul@10 | 240 | |
paul@11 | 241 | /* Inner top cutout for the top of the back portion. */ |
paul@11 | 242 | |
paul@11 | 243 | translate([0, -inner_top_front_cutout_depth / 2, height / 2 - |
paul@11 | 244 | inner_top_front_cutout_offset - |
paul@11 | 245 | inner_top_front_cutout_depth / 2]) |
paul@11 | 246 | cube([inner_top_front_cutout_width, |
paul@11 | 247 | inner_top_front_cutout_depth, |
paul@11 | 248 | inner_top_front_cutout_depth], center = true); |
paul@11 | 249 | |
paul@10 | 250 | /* Fillets to round off the edges. */ |
paul@10 | 251 | |
paul@10 | 252 | union() { |
paul@10 | 253 | |
paul@10 | 254 | /* Top left and right rounding. */ |
paul@10 | 255 | |
paul@10 | 256 | translate([-width / 2 + ro, -front_depth / 2, height / 2 - ro]) |
paul@10 | 257 | rotate([0, 0, 180]) |
paul@10 | 258 | rotate([90, 0, 0]) |
paul@10 | 259 | fillet(rr, front_depth); |
paul@10 | 260 | translate([width / 2 - ro, -front_depth / 2, height / 2 - ro]) |
paul@10 | 261 | rotate([90, 0, 0]) |
paul@10 | 262 | fillet(rr, front_depth); |
paul@10 | 263 | |
paul@10 | 264 | /* Top front rounding. */ |
paul@10 | 265 | |
paul@10 | 266 | translate([0, -front_depth + ro, height / 2 - ro]) |
paul@10 | 267 | rotate([0, 0, 180]) |
paul@10 | 268 | rotate([0, -90, 0]) |
paul@10 | 269 | fillet(rr, width); |
paul@10 | 270 | |
paul@10 | 271 | /* Edge rounding. */ |
paul@10 | 272 | |
paul@10 | 273 | translate([-width / 2 + ro, -front_depth + ro, 0]) |
paul@10 | 274 | rotate([0, 0, 180]) |
paul@10 | 275 | fillet(rr, height); |
paul@10 | 276 | translate([width / 2 - ro, -front_depth + ro, 0]) |
paul@10 | 277 | rotate([0, 0, 270]) |
paul@10 | 278 | fillet(rr, height); |
paul@10 | 279 | } |
paul@10 | 280 | } |
paul@10 | 281 | |
paul@19 | 282 | translate([width * 0.6, 0, 0]) |
paul@19 | 283 | rotate([0, 0, 180]) |
paul@10 | 284 | difference() { |
paul@10 | 285 | |
paul@10 | 286 | /* The cartridge surfaces. */ |
paul@10 | 287 | |
paul@10 | 288 | union() { |
paul@8 | 289 | |
paul@8 | 290 | /* Back portion. */ |
paul@8 | 291 | |
paul@8 | 292 | translate([0, back_depth - back / 2, 0]) |
paul@0 | 293 | cube([width, back, height], center = true); |
paul@8 | 294 | translate([-width / 2 + back_left / 2, back_depth / 2, 0]) |
paul@8 | 295 | cube([back_left, back_depth, height], center = true); |
paul@8 | 296 | translate([width / 2 - back_right / 2, back_depth / 2, 0]) |
paul@8 | 297 | cube([back_right, back_depth, height], center = true); |
paul@8 | 298 | translate([0, back_depth / 2, height / 2 - top / 2]) |
paul@8 | 299 | cube([width, back_depth, top], center = true); |
paul@8 | 300 | difference() { |
paul@20 | 301 | |
paul@20 | 302 | /* Floor of cartridge. */ |
paul@20 | 303 | |
paul@20 | 304 | cube_at(width, back_depth, bottom, |
paul@20 | 305 | 0, 1, 1, |
paul@20 | 306 | 0, 0, -height / 2 + bottom_from_base); |
paul@20 | 307 | |
paul@20 | 308 | /* Edge connector cutout. */ |
paul@20 | 309 | |
paul@20 | 310 | cube_at(edge_connector_cutout_back_width, |
paul@20 | 311 | edge_connector_cutout_back_depth, |
paul@20 | 312 | bottom, |
paul@20 | 313 | 0, 1, 1, |
paul@20 | 314 | 0, 0, -height / 2 + bottom_from_base); |
paul@8 | 315 | } |
paul@14 | 316 | |
paul@14 | 317 | /* PCB supports. */ |
paul@14 | 318 | |
paul@14 | 319 | translate([-edge_connector_cutout_back_width / 2 + |
paul@14 | 320 | pcb_back_support_width / 2, |
paul@14 | 321 | edge_connector_cutout_back_depth + |
paul@14 | 322 | pcb_back_support_depth / 2, |
paul@14 | 323 | -height / 2 + bottom + bottom_from_base + |
paul@14 | 324 | pcb_back_support_height / 2]) |
paul@16 | 325 | union() { |
paul@16 | 326 | cube([pcb_back_support_width, pcb_back_support_depth, |
paul@16 | 327 | pcb_back_support_height], center = true); |
paul@20 | 328 | cube_at(pcb_back_support_bump_width, |
paul@20 | 329 | pcb_back_support_bump_depth, |
paul@20 | 330 | pcb_back_support_left_bump_height, |
paul@20 | 331 | 0, -1, 1, |
paul@20 | 332 | 0, |
paul@20 | 333 | -pcb_back_support_depth / 2, |
paul@16 | 334 | -pcb_back_support_height / 2 + |
paul@20 | 335 | pcb_back_support_left_bump_offset_from_bottom); |
paul@16 | 336 | } |
paul@14 | 337 | |
paul@14 | 338 | translate([edge_connector_cutout_back_width / 2 - |
paul@14 | 339 | pcb_back_support_width / 2, |
paul@14 | 340 | edge_connector_cutout_back_depth + |
paul@14 | 341 | pcb_back_support_depth / 2, |
paul@14 | 342 | -height / 2 + bottom + bottom_from_base + |
paul@14 | 343 | pcb_back_support_height / 2]) |
paul@16 | 344 | union() { |
paul@16 | 345 | cube([pcb_back_support_width, pcb_back_support_depth, |
paul@16 | 346 | pcb_back_support_height], center = true); |
paul@20 | 347 | cube_at(pcb_back_support_bump_width, |
paul@20 | 348 | pcb_back_support_bump_depth, |
paul@20 | 349 | pcb_back_support_right_bump_height, |
paul@20 | 350 | 0, -1, 1, |
paul@20 | 351 | 0, |
paul@20 | 352 | -pcb_back_support_depth / 2, |
paul@16 | 353 | -pcb_back_support_height / 2 + |
paul@20 | 354 | pcb_back_support_right_bump_offset_from_bottom); |
paul@16 | 355 | } |
paul@0 | 356 | } |
paul@0 | 357 | |
paul@1 | 358 | /* Label insets. */ |
paul@1 | 359 | |
paul@1 | 360 | union() { |
paul@1 | 361 | |
paul@1 | 362 | /* Top label. */ |
paul@1 | 363 | |
paul@1 | 364 | translate([-top_label_width / 2, |
paul@8 | 365 | -front_depth + top_label_offset_from_front, |
paul@1 | 366 | height / 2 - top_label_depth]) |
paul@1 | 367 | cube([top_label_width, top_label_height, |
paul@1 | 368 | top_label_depth]); |
paul@1 | 369 | } |
paul@1 | 370 | |
paul@8 | 371 | /* Top and side grooves, positioned in the back portion. */ |
paul@2 | 372 | |
paul@2 | 373 | union() { |
paul@2 | 374 | |
paul@2 | 375 | /* Left groove. */ |
paul@2 | 376 | |
paul@8 | 377 | translate([-width / 2 + groove_depth / 2, groove_width / 2, 0]) |
paul@8 | 378 | cube([groove_depth, groove_width, height], |
paul@4 | 379 | center = true); |
paul@2 | 380 | |
paul@2 | 381 | /* Right groove. */ |
paul@2 | 382 | |
paul@8 | 383 | translate([width / 2 - groove_depth / 2, groove_width / 2, 0]) |
paul@8 | 384 | cube([groove_depth, groove_width, height], |
paul@4 | 385 | center = true); |
paul@2 | 386 | |
paul@8 | 387 | /* Top grooves. */ |
paul@2 | 388 | |
paul@8 | 389 | translate([0, groove_width / 2, height / 2 - groove_depth / 2]) |
paul@8 | 390 | cube([width, groove_width, groove_depth], |
paul@8 | 391 | center = true); |
paul@8 | 392 | |
paul@8 | 393 | translate([0, top_groove_width / 2, |
paul@8 | 394 | height / 2 - top_groove_depth / 2]) |
paul@8 | 395 | cube([width, top_groove_width, top_groove_depth], |
paul@4 | 396 | center = true); |
paul@4 | 397 | } |
paul@4 | 398 | |
paul@4 | 399 | /* Back cavity. */ |
paul@4 | 400 | |
paul@4 | 401 | intersection() { |
paul@4 | 402 | |
paul@4 | 403 | /* From the bottom upwards. */ |
paul@4 | 404 | |
paul@8 | 405 | translate([0, back_depth, -height / 2]) |
paul@4 | 406 | linear_extrude(height = back_cavity_height) |
paul@4 | 407 | translate([-width / 2, 0, 0]) |
paul@4 | 408 | polygon([ |
paul@4 | 409 | [back_cavity_offset_from_left, 0], |
paul@4 | 410 | [back_cavity_inner_offset_from_left, |
paul@4 | 411 | -back_cavity_depth], |
paul@4 | 412 | [back_cavity_inner_offset_from_left + |
paul@4 | 413 | back_cavity_inner_width, |
paul@4 | 414 | -back_cavity_depth], |
paul@4 | 415 | [back_cavity_offset_from_left + |
paul@4 | 416 | back_cavity_width, 0] |
paul@4 | 417 | ]); |
paul@4 | 418 | |
paul@4 | 419 | /* From left to right. */ |
paul@4 | 420 | |
paul@8 | 421 | translate([back_cavity_width / 2, back_depth, -height / 2]) |
paul@4 | 422 | rotate([0, -90, 0]) |
paul@4 | 423 | linear_extrude(height = back_cavity_width) |
paul@4 | 424 | polygon([ |
paul@4 | 425 | [-extra, -back_cavity_depth], |
paul@4 | 426 | [back_cavity_inner_height, |
paul@4 | 427 | -back_cavity_depth], |
paul@4 | 428 | [back_cavity_height, 0], |
paul@4 | 429 | [-extra, 0] |
paul@4 | 430 | ]); |
paul@2 | 431 | } |
paul@2 | 432 | |
paul@5 | 433 | /* Inner back cavities. */ |
paul@5 | 434 | |
paul@8 | 435 | translate([0, back_depth - inner_back_cavity_offset, -height / 2]) |
paul@5 | 436 | linear_extrude(height = bottom_from_base) |
paul@5 | 437 | translate([-width / 2, 0, 0]) |
paul@5 | 438 | polygon([ |
paul@5 | 439 | [inner_back_cavity_offset_from_left, 0], |
paul@5 | 440 | [inner_back_slope_offset_from_left, 0], |
paul@5 | 441 | [inner_back_slope_offset_from_left + |
paul@5 | 442 | inner_back_slope_width, |
paul@5 | 443 | -inner_back_slope_depth], |
paul@5 | 444 | [inner_back_cavity_offset_from_left, |
paul@5 | 445 | -inner_back_slope_depth] |
paul@5 | 446 | ]); |
paul@5 | 447 | |
paul@8 | 448 | translate([0, back_depth - inner_back_cavity_offset, -height / 2]) |
paul@5 | 449 | linear_extrude(height = bottom_from_base) |
paul@5 | 450 | translate([-width / 2, 0, 0]) |
paul@5 | 451 | polygon([ |
paul@5 | 452 | [width - inner_back_slope_offset_from_left, 0], |
paul@5 | 453 | [width - inner_back_cavity_offset_from_left, 0], |
paul@5 | 454 | [width - inner_back_cavity_offset_from_left, |
paul@5 | 455 | -inner_back_slope_depth], |
paul@5 | 456 | [width - inner_back_slope_offset_from_left - |
paul@5 | 457 | inner_back_slope_width, |
paul@5 | 458 | -inner_back_slope_depth] |
paul@5 | 459 | ]); |
paul@5 | 460 | |
paul@7 | 461 | /* Inner back edge cavity. */ |
paul@7 | 462 | |
paul@5 | 463 | translate([inner_back_edge_width / 2, |
paul@8 | 464 | back_depth - inner_back_edge_offset, -height / 2]) |
paul@5 | 465 | rotate([0, -90, 0]) |
paul@5 | 466 | linear_extrude(height = inner_back_edge_width) |
paul@5 | 467 | polygon([ |
paul@5 | 468 | [-extra, -inner_back_edge_depth], |
paul@5 | 469 | [inner_back_edge_height, -inner_back_edge_depth], |
paul@5 | 470 | [0, 0], |
paul@5 | 471 | [-extra, 0] |
paul@5 | 472 | ]); |
paul@5 | 473 | |
paul@1 | 474 | /* Fillets to round off the edges. */ |
paul@1 | 475 | |
paul@0 | 476 | union() { |
paul@0 | 477 | |
paul@0 | 478 | /* Top left and right rounding. */ |
paul@0 | 479 | |
paul@9 | 480 | translate([-width / 2 + ro, back_depth / 2, height / 2 - ro]) |
paul@9 | 481 | rotate([0, 0, 180]) |
paul@9 | 482 | rotate([90, 0, 0]) |
paul@9 | 483 | fillet(rr, back_depth); |
paul@9 | 484 | translate([width / 2 - ro, back_depth / 2, height / 2 - ro]) |
paul@9 | 485 | rotate([90, 0, 0]) |
paul@9 | 486 | fillet(rr, back_depth); |
paul@0 | 487 | |
paul@10 | 488 | /* Top back rounding. */ |
paul@0 | 489 | |
paul@8 | 490 | translate([0, back_depth - ro, height / 2 - ro]) |
paul@0 | 491 | rotate([0, -90, 0]) |
paul@3 | 492 | fillet(rr, width); |
paul@0 | 493 | |
paul@0 | 494 | /* Edge rounding. */ |
paul@0 | 495 | |
paul@8 | 496 | translate([width / 2 - ro, back_depth - ro, 0]) |
paul@3 | 497 | fillet(rr, height); |
paul@8 | 498 | translate([-width / 2 + ro, back_depth - ro, 0]) |
paul@0 | 499 | rotate([0, 0, 90]) |
paul@3 | 500 | fillet(rr, height); |
paul@0 | 501 | } |
paul@0 | 502 | } |
paul@0 | 503 | } |
paul@0 | 504 | |
paul@0 | 505 | cartridge(); |
paul@0 | 506 | |