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