paul@22 | 1 | /* |
paul@22 | 2 | Copyright (C) 2014 Paul Boddie |
paul@22 | 3 | |
paul@22 | 4 | This program is free software; you can redistribute it and/or modify it under |
paul@22 | 5 | the terms of the GNU General Public License as published by the Free Software |
paul@22 | 6 | Foundation; either version 3 of the License, or (at your option) any later |
paul@22 | 7 | version. |
paul@22 | 8 | |
paul@22 | 9 | This program is distributed in the hope that it will be useful, but WITHOUT |
paul@22 | 10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
paul@22 | 11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
paul@22 | 12 | more details. |
paul@22 | 13 | |
paul@22 | 14 | You should have received a copy of the GNU General Public License along with |
paul@22 | 15 | this program. If not, see <http://www.gnu.org/licenses/>. |
paul@22 | 16 | */ |
paul@22 | 17 | |
paul@0 | 18 | module cartridge() |
paul@0 | 19 | { |
paul@0 | 20 | $fn = 50; |
paul@0 | 21 | |
paul@41 | 22 | /* Configure the generated shapes. */ |
paul@41 | 23 | |
paul@41 | 24 | BACK_CAVITY = 1; |
paul@41 | 25 | FRONT_LABEL_INSET = 1; |
paul@41 | 26 | TOP_LABEL_INSET = 1; |
paul@41 | 27 | GROOVE = 1; |
paul@41 | 28 | |
paul@45 | 29 | /* |
paul@45 | 30 | Options for checking. Some useful combinations... |
paul@45 | 31 | |
paul@45 | 32 | Check feature alignment: APART = 0; BACK_SURFACE = 0; FRONT_SURFACE = 0; |
paul@45 | 33 | Check PCB alignment: PCB = 1; BACK_SURFACE = 0; |
paul@45 | 34 | */ |
paul@45 | 35 | |
paul@43 | 36 | BACK = 1; BACK_SURFACE = 1; |
paul@43 | 37 | FRONT = 1; FRONT_SURFACE = 1; |
paul@45 | 38 | |
paul@45 | 39 | /* For printing: APART = 1; PCB = 0; */ |
paul@45 | 40 | |
paul@43 | 41 | APART = 1; |
paul@45 | 42 | PCB = 0; |
paul@43 | 43 | |
paul@48 | 44 | /* To save time (before printing): FILLET = 0; */ |
paul@48 | 45 | |
paul@48 | 46 | FILLET = 1; |
paul@48 | 47 | |
paul@22 | 48 | /* |
paul@22 | 49 | Rounding/fillet radius and additional margin of subtracted |
paul@22 | 50 | material. The additional margin helps avoid geometry problems. |
paul@22 | 51 | */ |
paul@3 | 52 | |
paul@23 | 53 | rr = 2; |
paul@3 | 54 | ro = rr; |
paul@3 | 55 | extra = 0.1; |
paul@3 | 56 | |
paul@47 | 57 | groove_rr = 0.2; |
paul@46 | 58 | groove_ro = groove_rr; |
paul@46 | 59 | |
paul@47 | 60 | pcb_lug_rr = 0.5; |
paul@47 | 61 | pcb_lug_ro = pcb_lug_rr; |
paul@47 | 62 | |
paul@47 | 63 | /* A fillet performs rounding using a quarter segment of a cylinder. */ |
paul@47 | 64 | |
paul@0 | 65 | module fillet(r, h) { |
paul@48 | 66 | if (FILLET) |
paul@48 | 67 | translate([0, 0, -h/2]) |
paul@48 | 68 | difference() { |
paul@48 | 69 | cube([r + extra, r + extra, h + extra]); |
paul@48 | 70 | cylinder(r = r, h = h); |
paul@48 | 71 | } |
paul@48 | 72 | } |
paul@48 | 73 | |
paul@48 | 74 | module fillet_justified(r, h) { |
paul@48 | 75 | if (FILLET) |
paul@0 | 76 | difference() { |
paul@12 | 77 | cube([r + extra, r + extra, h + extra]); |
paul@0 | 78 | cylinder(r = r, h = h); |
paul@0 | 79 | } |
paul@0 | 80 | } |
paul@0 | 81 | |
paul@47 | 82 | module fillet_torus(radius, rounding) { |
paul@48 | 83 | if (FILLET) |
paul@48 | 84 | difference() { |
paul@48 | 85 | cube_at((radius + extra) * 2, (radius + extra) * 2, rounding + extra, |
paul@48 | 86 | 0, 0, 1, |
paul@48 | 87 | 0, 0, 0); |
paul@48 | 88 | union() { |
paul@48 | 89 | rotate_extrude(convexity = 10) |
paul@48 | 90 | translate([radius - rounding, 0, 0]) |
paul@48 | 91 | circle(r = rounding); |
paul@48 | 92 | cylinder(r = radius - rounding, h = rounding); |
paul@48 | 93 | } |
paul@47 | 94 | } |
paul@47 | 95 | } |
paul@47 | 96 | |
paul@20 | 97 | /* |
paul@21 | 98 | Justify an object of the given dimensions, according to the given |
paul@21 | 99 | factors (where 1 indicates moving the object to the positive side of an |
paul@21 | 100 | axis, and -1 indicates moving it to the negative side of an axis). |
paul@21 | 101 | |
paul@21 | 102 | NOTE: child should eventually be replaced by children. |
paul@21 | 103 | */ |
paul@21 | 104 | module justify(width, depth, height, wdir, ddir, hdir) { |
paul@21 | 105 | translate([ |
paul@21 | 106 | wdir * width / 2, |
paul@21 | 107 | ddir * depth / 2, |
paul@21 | 108 | hdir * height / 2]) |
paul@21 | 109 | child(); |
paul@21 | 110 | } |
paul@21 | 111 | |
paul@21 | 112 | /* |
paul@20 | 113 | Make a cuboid of the given dimensions, justifying it according to the given |
paul@21 | 114 | factors, and moving it to the specified coordinates. |
paul@21 | 115 | |
paul@21 | 116 | NOTE: Usage of justify within this module will not work due to recursion |
paul@21 | 117 | NOTE: limitations in openscad, potentially removed in more recent |
paul@21 | 118 | NOTE: releases. Thus, the justify transform is merged in here. |
paul@20 | 119 | */ |
paul@20 | 120 | module cube_at(width, depth, height, wdir, ddir, hdir, x, y, z) { |
paul@20 | 121 | translate([ |
paul@20 | 122 | x + wdir * width / 2, |
paul@20 | 123 | y + ddir * depth / 2, |
paul@20 | 124 | z + hdir * height / 2]) |
paul@20 | 125 | cube([width, depth, height], center = true); |
paul@20 | 126 | } |
paul@20 | 127 | |
paul@38 | 128 | /* Internal dimensions. */ |
paul@0 | 129 | |
paul@38 | 130 | int_width = 86.0; |
paul@49 | 131 | int_payload_depth = 12.5; /* maximum depth in the payload section */ |
paul@49 | 132 | int_connector_depth = 11.0; /* maximum depth in the connector section */ |
paul@42 | 133 | int_payload_height = 50.8; /* space between the top and the floor */ |
paul@42 | 134 | int_connector_height = 13.5; /* vertical offset of bottom/floor of payload area */ |
paul@0 | 135 | |
paul@24 | 136 | /* Side thicknesses. */ |
paul@24 | 137 | |
paul@24 | 138 | front = 2; |
paul@49 | 139 | payload_back = 2; /* in the payload area the thickness is reduced */ |
paul@49 | 140 | connector_back = 3.5; /* the back cavity requires a thicker back wall */ |
paul@24 | 141 | top = 3; |
paul@42 | 142 | side = 2; /* increased from 1.5 for 3D printing reliability */ |
paul@42 | 143 | bottom = 1; /* thickness of floor of payload area */ |
paul@34 | 144 | |
paul@38 | 145 | /* How much extra depth the back provides for mating with the front. */ |
paul@38 | 146 | |
paul@42 | 147 | groove_width_extra = 1.0; |
paul@42 | 148 | front_back_overlap = 1.0; |
paul@42 | 149 | groove_width_overlap = front_back_overlap + groove_width_extra; |
paul@38 | 150 | |
paul@39 | 151 | /* Division of pieces into front and back, defining the extents. */ |
paul@38 | 152 | |
paul@39 | 153 | int_front_depth = 4.5; |
paul@39 | 154 | front_depth = int_front_depth + front; |
paul@49 | 155 | int_payload_back_depth = int_payload_depth - int_front_depth + front_back_overlap; |
paul@49 | 156 | int_connector_back_depth = int_connector_depth - int_front_depth + front_back_overlap; |
paul@49 | 157 | back_depth = int_payload_back_depth + payload_back; |
paul@38 | 158 | |
paul@38 | 159 | /* Cartridge dimensions. */ |
paul@38 | 160 | |
paul@38 | 161 | width = int_width + side + side; |
paul@49 | 162 | payload_height = top + int_payload_height; |
paul@49 | 163 | connector_height = bottom + int_connector_height; |
paul@49 | 164 | height = payload_height + bottom + int_connector_height; |
paul@49 | 165 | depth = int_payload_depth + front + payload_back; |
paul@42 | 166 | int_payload_upper_extent = height / 2 - top; |
paul@45 | 167 | int_payload_lower_extent = -height / 2 + int_connector_height + bottom; |
paul@38 | 168 | |
paul@38 | 169 | /* Cartridge surfaces. */ |
paul@38 | 170 | |
paul@34 | 171 | front_side = side; |
paul@29 | 172 | front_left = front_side; |
paul@29 | 173 | front_right = front_side; |
paul@34 | 174 | back_side = side; |
paul@29 | 175 | back_left = back_side; |
paul@29 | 176 | back_right = back_side; |
paul@24 | 177 | |
paul@20 | 178 | /* Label details. */ |
paul@1 | 179 | |
paul@1 | 180 | front_label_width = 83.0; |
paul@1 | 181 | front_label_height = 46.0; |
paul@1 | 182 | front_label_depth = 1.0; |
paul@1 | 183 | front_label_offset_from_bottom = 19.5; |
paul@3 | 184 | |
paul@1 | 185 | top_label_width = front_label_width; |
paul@20 | 186 | top_label_height = 11.5; /* the height as seen from above */ |
paul@1 | 187 | top_label_depth = front_label_depth; |
paul@1 | 188 | top_label_offset_from_front = 2.5; |
paul@3 | 189 | |
paul@41 | 190 | /* |
paul@41 | 191 | The groove around the sides and top. This is extended to allow the |
paul@41 | 192 | pieces to fit together, and this extension is generated regardless of |
paul@41 | 193 | whether the visible groove is enabled or not. |
paul@41 | 194 | */ |
paul@20 | 195 | |
paul@41 | 196 | groove_width_exposed = GROOVE ? 1.5 : 0; |
paul@46 | 197 | groove_width_normal = groove_width_exposed + front_back_overlap; |
paul@8 | 198 | groove_depth = 1.0; /* how deep the groove goes into each side */ |
paul@20 | 199 | |
paul@20 | 200 | /* Additional cutting to mate the back and front. */ |
paul@20 | 201 | |
paul@42 | 202 | top_groove_width = groove_width_overlap; |
paul@8 | 203 | top_groove_depth = 2.0; |
paul@20 | 204 | |
paul@29 | 205 | /* |
paul@29 | 206 | Space for the inner edge of the back inside the front. |
paul@29 | 207 | Offsets are measured from the outside surfaces. |
paul@29 | 208 | */ |
paul@20 | 209 | |
paul@42 | 210 | inner_top_front_cutout_width = int_width; |
paul@30 | 211 | inner_top_front_cutout_depth = top_groove_width; |
paul@30 | 212 | inner_top_front_cutout_height = top - top_groove_depth; |
paul@28 | 213 | |
paul@42 | 214 | inner_side_front_cutout_height = height - top_groove_depth; |
paul@30 | 215 | inner_side_front_cutout_width = front_side - groove_depth; |
paul@42 | 216 | inner_side_front_cutout_depth = groove_width_overlap; |
paul@1 | 217 | |
paul@35 | 218 | /* |
paul@35 | 219 | The back cavity is the indented part at the bottom of the back of the |
paul@40 | 220 | cartridge. It appears to be mechanically superfluous, just making the |
paul@40 | 221 | shape of the cartridge look a bit fancier. |
paul@35 | 222 | */ |
paul@35 | 223 | |
paul@4 | 224 | back_cavity_width = 68.0; |
paul@4 | 225 | back_cavity_inner_width = 65.0; |
paul@40 | 226 | back_cavity_offset_from_inner_left = 9.0; |
paul@40 | 227 | back_cavity_inner_offset_from_inner_left = 10.5; |
paul@4 | 228 | back_cavity_height = 13.5; |
paul@4 | 229 | back_cavity_inner_height = 12.0; |
paul@4 | 230 | back_cavity_depth = 1.5; |
paul@4 | 231 | |
paul@39 | 232 | /* |
paul@40 | 233 | The effect of the cavity on the inside of the case. The most important |
paul@40 | 234 | measurement is the maximum offset since it defines the width of the |
paul@40 | 235 | internal space that should accommodate the plastic guides of the Plus 1 |
paul@40 | 236 | socket. |
paul@39 | 237 | */ |
paul@35 | 238 | |
paul@6 | 239 | inner_back_slope_depth = 2.5; |
paul@40 | 240 | inner_back_slope_width = inner_back_slope_depth; |
paul@40 | 241 | inner_back_slope_max_offset = 10.5; |
paul@40 | 242 | inner_back_slope_min_offset = inner_back_slope_max_offset - inner_back_slope_width; |
paul@5 | 243 | |
paul@40 | 244 | /* The tapering off of the inner back edge. */ |
paul@40 | 245 | |
paul@5 | 246 | inner_back_edge_width = 69.0; |
paul@5 | 247 | inner_back_edge_height = 3.0; |
paul@5 | 248 | inner_back_edge_depth = 1.5; |
paul@5 | 249 | |
paul@40 | 250 | /* The tapering off of the inner front edge. */ |
paul@40 | 251 | |
paul@34 | 252 | inner_front_edge_width = width - front_side * 2; |
paul@7 | 253 | inner_front_edge_height = 3.0; |
paul@7 | 254 | inner_front_edge_depth = 1.5; |
paul@7 | 255 | |
paul@39 | 256 | /* |
paul@39 | 257 | The cutout in the floor of the back of the cartridge that accommodates |
paul@39 | 258 | the edge connector. |
paul@39 | 259 | */ |
paul@39 | 260 | |
paul@8 | 261 | edge_connector_cutout_back_depth = 3.0; |
paul@23 | 262 | edge_connector_cutout_back_width = 57.5; |
paul@8 | 263 | |
paul@17 | 264 | /* |
paul@49 | 265 | The cutouts in the floor of the front of the cartridge that produce a |
paul@49 | 266 | kind of tab that guides the edge connector into place in the back cutout. |
paul@49 | 267 | */ |
paul@49 | 268 | |
paul@49 | 269 | edge_connector_cutout_front_depth = front_back_overlap; |
paul@49 | 270 | edge_connector_cutout_front_width = (int_width - edge_connector_cutout_back_width) / 2; |
paul@49 | 271 | |
paul@49 | 272 | /* |
paul@17 | 273 | Edge connectors are themselves 0.05" or approximately 1.27mm in |
paul@17 | 274 | thickness according to the Acorn Electron Cartridge Interface Specification |
paul@17 | 275 | (Acorn Support Application Group Note 014). |
paul@17 | 276 | */ |
paul@17 | 277 | |
paul@33 | 278 | /* Extra internal features. Depths include front and back surfaces. */ |
paul@14 | 279 | |
paul@23 | 280 | pcb_back_support_width = 1.2; |
paul@14 | 281 | pcb_back_support_depth = back_depth - |
paul@14 | 282 | edge_connector_cutout_back_depth; |
paul@38 | 283 | pcb_back_support_height = height - int_connector_height - top - bottom; |
paul@14 | 284 | |
paul@23 | 285 | pcb_front_support_width = 1.2; |
paul@44 | 286 | pcb_front_support_depth = int_front_depth; |
paul@15 | 287 | pcb_front_support_height = pcb_back_support_height; |
paul@15 | 288 | |
paul@16 | 289 | /* |
paul@45 | 290 | Features measured from the Stardot Dual ROM Adaptor cartridge board |
paul@37 | 291 | dimensions diagram. Offsets are from inside the bottom "floor". |
paul@16 | 292 | */ |
paul@16 | 293 | |
paul@16 | 294 | pcb_back_support_bump_width = pcb_front_support_width; |
paul@18 | 295 | pcb_back_support_bump_depth = 1.5; |
paul@23 | 296 | pcb_back_support_left_bump_height = 13.2; |
paul@23 | 297 | pcb_back_support_right_bump_height = 10.7; |
paul@23 | 298 | pcb_back_support_left_bump_offset_from_bottom = 15.1; |
paul@23 | 299 | pcb_back_support_right_bump_offset_from_bottom = 17.6; |
paul@27 | 300 | pcb_back_support_top_bump_height = 3.8; |
paul@16 | 301 | |
paul@24 | 302 | /* Move the PCB support towards the centre. */ |
paul@35 | 303 | pcb_support_margin = 1.75; |
paul@37 | 304 | pcb_support_offset_from_centre = edge_connector_cutout_back_width / 2 |
paul@37 | 305 | - pcb_support_margin; |
paul@24 | 306 | |
paul@25 | 307 | pcb_lug_depth = pcb_back_support_depth + |
paul@25 | 308 | pcb_back_support_bump_depth; |
paul@25 | 309 | pcb_lug_inner_radius = 1.0; |
paul@25 | 310 | pcb_lug_outer_radius = 5.5 / 2; |
paul@25 | 311 | pcb_lug_offset_from_bottom = 14.35; |
paul@45 | 312 | pcb_lug_offset_from_inside = 5.55; |
paul@25 | 313 | |
paul@25 | 314 | pcb_lug_cross_width = 6.7; |
paul@33 | 315 | pcb_lug_cross_depth = pcb_back_support_depth; |
paul@25 | 316 | pcb_lug_cross_height = 1.4; |
paul@25 | 317 | |
paul@33 | 318 | pcb_front_lug_depth = pcb_back_support_bump_depth + |
paul@44 | 319 | pcb_front_support_depth; |
paul@33 | 320 | pcb_front_lug_inner_radius = pcb_lug_outer_radius; |
paul@33 | 321 | pcb_front_lug_outer_radius = pow( |
paul@33 | 322 | pow(pcb_lug_cross_width / 2, 2) + |
paul@33 | 323 | pow(pcb_lug_cross_height / 2, 2), |
paul@33 | 324 | 0.5); |
paul@33 | 325 | |
paul@25 | 326 | /* Repeated constructs. */ |
paul@25 | 327 | |
paul@26 | 328 | module pcb_support(xdir, bump_height, bump_offset) { |
paul@35 | 329 | |
paul@35 | 330 | /* |
paul@35 | 331 | Translate the support in the stated direction. |
paul@35 | 332 | Since the support is already justified in the direction, the translation |
paul@35 | 333 | moves the inner edge of the support to alignment with the end of the |
paul@35 | 334 | edge connector cutout and then back by the PCB support margin. |
paul@35 | 335 | */ |
paul@35 | 336 | |
paul@25 | 337 | translate([xdir * |
paul@37 | 338 | pcb_support_offset_from_centre, |
paul@25 | 339 | edge_connector_cutout_back_depth, |
paul@45 | 340 | int_payload_lower_extent]) |
paul@25 | 341 | justify(pcb_back_support_width, |
paul@25 | 342 | pcb_back_support_depth, |
paul@25 | 343 | pcb_back_support_height, |
paul@25 | 344 | xdir, 1, 1) |
paul@25 | 345 | union() { |
paul@27 | 346 | |
paul@27 | 347 | /* Underlying support strut. */ |
paul@27 | 348 | |
paul@25 | 349 | cube([pcb_back_support_width, |
paul@25 | 350 | pcb_back_support_depth, |
paul@25 | 351 | pcb_back_support_height], center = true); |
paul@27 | 352 | |
paul@27 | 353 | /* Middle bump. */ |
paul@27 | 354 | |
paul@25 | 355 | cube_at(pcb_back_support_bump_width, |
paul@25 | 356 | pcb_back_support_bump_depth, |
paul@26 | 357 | bump_height, |
paul@25 | 358 | 0, -1, 1, |
paul@25 | 359 | 0, |
paul@25 | 360 | -pcb_back_support_depth / 2, |
paul@26 | 361 | -pcb_back_support_height / 2 + bump_offset); |
paul@27 | 362 | |
paul@27 | 363 | /* Top bump. */ |
paul@27 | 364 | |
paul@27 | 365 | cube_at(pcb_back_support_bump_width, |
paul@27 | 366 | pcb_back_support_bump_depth, |
paul@27 | 367 | pcb_back_support_top_bump_height, |
paul@27 | 368 | 0, -1, 1, |
paul@27 | 369 | 0, |
paul@27 | 370 | -pcb_back_support_depth / 2, |
paul@27 | 371 | pcb_back_support_height / 2 - |
paul@27 | 372 | pcb_back_support_top_bump_height); |
paul@25 | 373 | } |
paul@25 | 374 | } |
paul@25 | 375 | |
paul@25 | 376 | module pcb_lug(xdir) { |
paul@25 | 377 | translate([xdir * |
paul@45 | 378 | (int_width / 2 - pcb_lug_offset_from_inside), |
paul@25 | 379 | back_depth, |
paul@45 | 380 | int_payload_lower_extent + pcb_lug_offset_from_bottom |
paul@25 | 381 | ]) |
paul@25 | 382 | rotate([90, 0, 0]) |
paul@25 | 383 | difference() { |
paul@25 | 384 | union() { |
paul@25 | 385 | cylinder(h=pcb_lug_depth, r=pcb_lug_outer_radius); |
paul@25 | 386 | cube_at(pcb_lug_cross_width, |
paul@25 | 387 | pcb_lug_cross_height, pcb_lug_cross_depth, |
paul@25 | 388 | 0, 0, 1, |
paul@25 | 389 | 0, 0, 0); |
paul@25 | 390 | cube_at(pcb_lug_cross_height, |
paul@25 | 391 | pcb_lug_cross_width, pcb_lug_cross_depth, |
paul@25 | 392 | 0, 0, 1, |
paul@25 | 393 | 0, 0, 0); |
paul@25 | 394 | } |
paul@25 | 395 | cylinder(h=pcb_lug_depth, r=pcb_lug_inner_radius); |
paul@47 | 396 | translate([0, 0, pcb_lug_depth - pcb_lug_ro]) |
paul@47 | 397 | fillet_torus(pcb_lug_outer_radius, pcb_lug_rr); |
paul@25 | 398 | } |
paul@25 | 399 | } |
paul@25 | 400 | |
paul@33 | 401 | module pcb_front_lug(xdir) { |
paul@33 | 402 | translate([xdir * |
paul@45 | 403 | (int_width / 2 - pcb_lug_offset_from_inside), |
paul@39 | 404 | -int_front_depth + pcb_front_lug_depth, |
paul@45 | 405 | int_payload_lower_extent + pcb_lug_offset_from_bottom |
paul@33 | 406 | ]) |
paul@33 | 407 | rotate([90, 0, 0]) |
paul@33 | 408 | difference() { |
paul@33 | 409 | cylinder(h=pcb_front_lug_depth, |
paul@33 | 410 | r=pcb_front_lug_outer_radius); |
paul@33 | 411 | cylinder(h=pcb_front_lug_depth, |
paul@33 | 412 | r=pcb_front_lug_inner_radius); |
paul@33 | 413 | } |
paul@33 | 414 | } |
paul@33 | 415 | |
paul@25 | 416 | /* The actual shapes. */ |
paul@25 | 417 | |
paul@43 | 418 | front_displacement = APART ? -width * 0.6 : 0; |
paul@43 | 419 | |
paul@43 | 420 | if (FRONT) |
paul@43 | 421 | translate([front_displacement, 0, 0]) |
paul@43 | 422 | difference() { |
paul@1 | 423 | |
paul@43 | 424 | /* The cartridge surfaces. */ |
paul@1 | 425 | |
paul@43 | 426 | union() { |
paul@8 | 427 | |
paul@43 | 428 | /* Front portion. */ |
paul@8 | 429 | |
paul@43 | 430 | if (FRONT_SURFACE) { |
paul@43 | 431 | cube_at(width, front, height, |
paul@43 | 432 | 0, -1, 0, |
paul@43 | 433 | 0, -int_front_depth, 0); |
paul@43 | 434 | cube_at(front_left, front_depth, height, |
paul@43 | 435 | -1, -1, 0, |
paul@43 | 436 | -int_width / 2, 0, 0); |
paul@43 | 437 | cube_at(front_right, front_depth, height, |
paul@43 | 438 | 1, -1, 0, |
paul@43 | 439 | int_width / 2, 0, 0); |
paul@43 | 440 | cube_at(width, front_depth, top, |
paul@43 | 441 | 0, -1, 1, |
paul@43 | 442 | 0, 0, int_payload_upper_extent); |
paul@43 | 443 | } |
paul@20 | 444 | |
paul@43 | 445 | difference() { |
paul@43 | 446 | |
paul@43 | 447 | /* Floor of cartridge. */ |
paul@43 | 448 | |
paul@45 | 449 | cube_at(int_width, int_front_depth, bottom, |
paul@43 | 450 | 0, -1, 1, |
paul@43 | 451 | 0, 0, -height / 2 + int_connector_height); |
paul@43 | 452 | |
paul@43 | 453 | /* Left cutout. */ |
paul@20 | 454 | |
paul@43 | 455 | cube_at(edge_connector_cutout_front_width, |
paul@43 | 456 | edge_connector_cutout_front_depth, |
paul@43 | 457 | bottom, |
paul@43 | 458 | 1, -1, 1, |
paul@49 | 459 | -int_width / 2, |
paul@43 | 460 | 0, |
paul@43 | 461 | -height / 2 + int_connector_height); |
paul@43 | 462 | |
paul@43 | 463 | /* Right cutout. */ |
paul@20 | 464 | |
paul@43 | 465 | cube_at(edge_connector_cutout_front_width, |
paul@43 | 466 | edge_connector_cutout_front_depth, |
paul@43 | 467 | bottom, |
paul@43 | 468 | -1, -1, 1, |
paul@49 | 469 | int_width / 2, |
paul@43 | 470 | 0, |
paul@43 | 471 | -height / 2 + int_connector_height); |
paul@43 | 472 | } |
paul@43 | 473 | |
paul@43 | 474 | /* PCB supports. */ |
paul@20 | 475 | |
paul@43 | 476 | cube_at(pcb_front_support_width, |
paul@43 | 477 | pcb_front_support_depth, |
paul@43 | 478 | pcb_front_support_height, |
paul@44 | 479 | -1, -1, 1, |
paul@44 | 480 | -pcb_support_offset_from_centre, |
paul@43 | 481 | 0, |
paul@45 | 482 | int_payload_lower_extent); |
paul@20 | 483 | |
paul@43 | 484 | cube_at(pcb_front_support_width, |
paul@43 | 485 | pcb_front_support_depth, |
paul@43 | 486 | pcb_front_support_height, |
paul@44 | 487 | 1, -1, 1, |
paul@44 | 488 | pcb_support_offset_from_centre, |
paul@43 | 489 | 0, |
paul@45 | 490 | int_payload_lower_extent); |
paul@20 | 491 | |
paul@43 | 492 | /* Circular "lugs" to hold PCBs in place. */ |
paul@43 | 493 | |
paul@43 | 494 | pcb_front_lug(-1); |
paul@43 | 495 | pcb_front_lug(1); |
paul@8 | 496 | } |
paul@15 | 497 | |
paul@43 | 498 | /* Label insets. */ |
paul@43 | 499 | |
paul@43 | 500 | union() { |
paul@43 | 501 | |
paul@43 | 502 | /* Front label. */ |
paul@15 | 503 | |
paul@43 | 504 | if (FRONT_LABEL_INSET) |
paul@43 | 505 | translate([-front_label_width / 2, -front_depth, |
paul@43 | 506 | front_label_offset_from_bottom - height / 2]) |
paul@43 | 507 | cube([front_label_width, front_label_depth, |
paul@43 | 508 | front_label_height]); |
paul@33 | 509 | |
paul@43 | 510 | /* Top label. See also the back piece. */ |
paul@10 | 511 | |
paul@43 | 512 | if (TOP_LABEL_INSET) |
paul@43 | 513 | translate([-top_label_width / 2, |
paul@43 | 514 | -front_depth + top_label_offset_from_front, |
paul@43 | 515 | height / 2 - top_label_depth]) |
paul@43 | 516 | cube([top_label_width, top_label_height, |
paul@43 | 517 | top_label_depth]); |
paul@43 | 518 | } |
paul@10 | 519 | |
paul@43 | 520 | /* Inner front edge cavity. */ |
paul@10 | 521 | |
paul@43 | 522 | translate([inner_front_edge_width / 2, -int_front_depth, -height / 2]) |
paul@43 | 523 | rotate([0, -90, 0]) |
paul@43 | 524 | linear_extrude(height = inner_front_edge_width) |
paul@43 | 525 | polygon([ |
paul@43 | 526 | [-extra, -inner_front_edge_depth], |
paul@43 | 527 | [0, -inner_front_edge_depth], |
paul@43 | 528 | [inner_front_edge_height, 0], |
paul@43 | 529 | [-extra, 0], |
paul@43 | 530 | ]); |
paul@10 | 531 | |
paul@43 | 532 | /* Inner top cutout for the top and sides of the back portion. */ |
paul@10 | 533 | |
paul@43 | 534 | cube_at(inner_top_front_cutout_width, |
paul@43 | 535 | inner_top_front_cutout_depth, |
paul@43 | 536 | inner_top_front_cutout_height, |
paul@43 | 537 | 0, -1, 1, |
paul@43 | 538 | 0, 0, int_payload_upper_extent); |
paul@11 | 539 | |
paul@43 | 540 | cube_at(inner_side_front_cutout_width, |
paul@43 | 541 | inner_side_front_cutout_depth, |
paul@43 | 542 | inner_side_front_cutout_height, |
paul@43 | 543 | 1, -1, 0, |
paul@43 | 544 | int_width / 2, 0, -inner_top_front_cutout_height); |
paul@11 | 545 | |
paul@43 | 546 | cube_at(inner_side_front_cutout_width, |
paul@43 | 547 | inner_side_front_cutout_depth, |
paul@43 | 548 | inner_side_front_cutout_height, |
paul@43 | 549 | -1, -1, 0, |
paul@43 | 550 | -int_width / 2, 0, -inner_top_front_cutout_height); |
paul@28 | 551 | |
paul@43 | 552 | /* Fillets to round off the edges. */ |
paul@43 | 553 | |
paul@43 | 554 | union() { |
paul@28 | 555 | |
paul@43 | 556 | /* Top left and right rounding. */ |
paul@43 | 557 | |
paul@43 | 558 | translate([-width / 2 + ro, -front_depth / 2, height / 2 - ro]) |
paul@43 | 559 | rotate([0, 0, 180]) |
paul@43 | 560 | rotate([90, 0, 0]) |
paul@43 | 561 | fillet(rr, front_depth); |
paul@43 | 562 | translate([width / 2 - ro, -front_depth / 2, height / 2 - ro]) |
paul@10 | 563 | rotate([90, 0, 0]) |
paul@10 | 564 | fillet(rr, front_depth); |
paul@10 | 565 | |
paul@43 | 566 | /* Top front rounding. */ |
paul@43 | 567 | |
paul@43 | 568 | translate([0, -front_depth + ro, height / 2 - ro]) |
paul@43 | 569 | rotate([0, 0, 180]) |
paul@43 | 570 | rotate([0, -90, 0]) |
paul@43 | 571 | fillet(rr, width); |
paul@10 | 572 | |
paul@43 | 573 | /* Edge rounding. */ |
paul@43 | 574 | |
paul@43 | 575 | translate([-width / 2 + ro, -front_depth + ro, 0]) |
paul@43 | 576 | rotate([0, 0, 180]) |
paul@43 | 577 | fillet(rr, height); |
paul@43 | 578 | translate([width / 2 - ro, -front_depth + ro, 0]) |
paul@43 | 579 | rotate([0, 0, 270]) |
paul@43 | 580 | fillet(rr, height); |
paul@43 | 581 | } |
paul@10 | 582 | } |
paul@10 | 583 | |
paul@41 | 584 | /* |
paul@41 | 585 | Place the back piece next to the front, with the internals facing out |
paul@43 | 586 | the same way, if APART is defined. |
paul@41 | 587 | */ |
paul@41 | 588 | |
paul@43 | 589 | back_displacement = APART ? width * 0.6 : 0; |
paul@43 | 590 | back_rotation = APART ? 180 : 0; |
paul@43 | 591 | |
paul@43 | 592 | if (BACK) |
paul@43 | 593 | translate([back_displacement, 0, 0]) |
paul@43 | 594 | rotate([0, 0, back_rotation]) |
paul@43 | 595 | difference() { |
paul@43 | 596 | |
paul@43 | 597 | /* The cartridge surfaces. */ |
paul@43 | 598 | |
paul@43 | 599 | union() { |
paul@43 | 600 | |
paul@43 | 601 | /* Back portion. */ |
paul@10 | 602 | |
paul@43 | 603 | if (BACK_SURFACE) { |
paul@49 | 604 | |
paul@49 | 605 | /* Payload section of back surface. */ |
paul@49 | 606 | |
paul@49 | 607 | cube_at(width, payload_back, payload_height, |
paul@49 | 608 | 0, 1, 1, |
paul@49 | 609 | 0, int_payload_back_depth, int_payload_lower_extent); |
paul@49 | 610 | |
paul@49 | 611 | /* Connector section of back surface overlapping the floor. */ |
paul@49 | 612 | |
paul@49 | 613 | cube_at(width, connector_back, connector_height, |
paul@49 | 614 | 0, 1, 1, |
paul@49 | 615 | 0, int_connector_back_depth, -height / 2); |
paul@49 | 616 | |
paul@49 | 617 | /* Sides of back piece. */ |
paul@46 | 618 | |
paul@46 | 619 | cube_at(back_left, back_depth, height, |
paul@43 | 620 | -1, 1, 0, |
paul@46 | 621 | -int_width / 2, 0, 0); |
paul@46 | 622 | |
paul@46 | 623 | cube_at(back_right, back_depth, height, |
paul@43 | 624 | 1, 1, 0, |
paul@46 | 625 | int_width / 2, 0, 0); |
paul@46 | 626 | |
paul@49 | 627 | /* Top of back piece. */ |
paul@49 | 628 | |
paul@46 | 629 | cube_at(width, back_depth, top, |
paul@43 | 630 | 0, 1, 1, |
paul@46 | 631 | 0, 0, int_payload_upper_extent); |
paul@46 | 632 | |
paul@46 | 633 | /* The extension of the back to connect with the front. */ |
paul@46 | 634 | |
paul@46 | 635 | difference() { |
paul@46 | 636 | cube_at(back_left - groove_depth, groove_width_extra, inner_side_front_cutout_height, |
paul@46 | 637 | -1, 1, 1, |
paul@46 | 638 | -int_width / 2, -groove_width_extra, -height / 2); |
paul@46 | 639 | translate([-int_width / 2 - groove_ro, -groove_width_extra + groove_ro, |
paul@46 | 640 | -height / 2]) |
paul@46 | 641 | rotate([0, 0, -90]) |
paul@46 | 642 | fillet_justified(groove_rr, inner_side_front_cutout_height); |
paul@46 | 643 | } |
paul@46 | 644 | |
paul@46 | 645 | difference() { |
paul@46 | 646 | cube_at(back_right - groove_depth, groove_width_extra, inner_side_front_cutout_height, |
paul@46 | 647 | 1, 1, 1, |
paul@46 | 648 | int_width / 2, -groove_width_extra, -height / 2); |
paul@46 | 649 | translate([int_width / 2 + groove_ro, -groove_width_extra + groove_ro, |
paul@46 | 650 | -height / 2]) |
paul@46 | 651 | rotate([0, 0, 180]) |
paul@46 | 652 | fillet_justified(groove_rr, inner_side_front_cutout_height); |
paul@46 | 653 | } |
paul@46 | 654 | |
paul@46 | 655 | difference() { |
paul@46 | 656 | cube_at(width - groove_depth * 2, groove_width_extra, top - top_groove_depth, |
paul@46 | 657 | 0, 1, 1, |
paul@46 | 658 | 0, -groove_width_extra, int_payload_upper_extent); |
paul@46 | 659 | translate([0, -groove_width_extra + groove_ro, |
paul@46 | 660 | int_payload_upper_extent + groove_ro]) |
paul@46 | 661 | rotate([0, 0, 180]) |
paul@46 | 662 | rotate([0, 90, 0]) |
paul@46 | 663 | fillet(groove_rr, width - groove_depth * 2); |
paul@46 | 664 | } |
paul@43 | 665 | } |
paul@10 | 666 | |
paul@43 | 667 | difference() { |
paul@8 | 668 | |
paul@43 | 669 | /* Floor of cartridge. */ |
paul@8 | 670 | |
paul@49 | 671 | cube_at(int_width, int_connector_back_depth, bottom, |
paul@43 | 672 | 0, 1, 1, |
paul@43 | 673 | 0, 0, -height / 2 + int_connector_height); |
paul@43 | 674 | |
paul@43 | 675 | /* Edge connector cutout. */ |
paul@43 | 676 | |
paul@43 | 677 | cube_at(edge_connector_cutout_back_width, |
paul@43 | 678 | edge_connector_cutout_back_depth, |
paul@43 | 679 | bottom, |
paul@43 | 680 | 0, 1, 1, |
paul@43 | 681 | 0, 0, -height / 2 + int_connector_height); |
paul@43 | 682 | } |
paul@43 | 683 | |
paul@43 | 684 | /* PCB supports. */ |
paul@42 | 685 | |
paul@43 | 686 | pcb_support(-1, pcb_back_support_left_bump_height, |
paul@43 | 687 | pcb_back_support_left_bump_offset_from_bottom); |
paul@43 | 688 | pcb_support(1, pcb_back_support_right_bump_height, |
paul@43 | 689 | pcb_back_support_right_bump_offset_from_bottom); |
paul@20 | 690 | |
paul@43 | 691 | /* Circular "lugs" to hold PCBs in place. */ |
paul@43 | 692 | |
paul@43 | 693 | pcb_lug(-1); |
paul@43 | 694 | pcb_lug(1); |
paul@43 | 695 | } |
paul@20 | 696 | |
paul@43 | 697 | /* Label insets. */ |
paul@43 | 698 | |
paul@43 | 699 | union() { |
paul@43 | 700 | |
paul@43 | 701 | /* Top label. See also the front piece. */ |
paul@20 | 702 | |
paul@43 | 703 | if (TOP_LABEL_INSET) |
paul@43 | 704 | translate([-top_label_width / 2, |
paul@43 | 705 | -front_depth + top_label_offset_from_front, |
paul@43 | 706 | height / 2 - top_label_depth]) |
paul@43 | 707 | cube([top_label_width, top_label_height, |
paul@43 | 708 | top_label_depth]); |
paul@8 | 709 | } |
paul@14 | 710 | |
paul@43 | 711 | /* Top and side grooves, positioned in the back portion. */ |
paul@25 | 712 | |
paul@43 | 713 | union() { |
paul@0 | 714 | |
paul@43 | 715 | /* Left groove. */ |
paul@1 | 716 | |
paul@46 | 717 | cube_at(groove_depth, groove_width_normal, height, |
paul@43 | 718 | 1, 1, 0, |
paul@46 | 719 | -width / 2, 0, 0); |
paul@2 | 720 | |
paul@43 | 721 | /* Right groove. */ |
paul@2 | 722 | |
paul@46 | 723 | cube_at(groove_depth, groove_width_normal, height, |
paul@43 | 724 | -1, 1, 0, |
paul@46 | 725 | width / 2, 0, 0); |
paul@8 | 726 | |
paul@43 | 727 | /* Top grooves. */ |
paul@4 | 728 | |
paul@46 | 729 | cube_at(width, groove_width_normal, groove_depth, |
paul@43 | 730 | 0, 1, -1, |
paul@46 | 731 | 0, 0, height / 2); |
paul@4 | 732 | |
paul@43 | 733 | cube_at(width, top_groove_width, top_groove_depth, |
paul@43 | 734 | 0, 1, -1, |
paul@43 | 735 | 0, -groove_width_extra, height / 2); |
paul@41 | 736 | } |
paul@2 | 737 | |
paul@43 | 738 | /* Back cavity. */ |
paul@43 | 739 | |
paul@43 | 740 | if (BACK_CAVITY) |
paul@43 | 741 | intersection() { |
paul@43 | 742 | |
paul@43 | 743 | /* From the bottom upwards. */ |
paul@5 | 744 | |
paul@43 | 745 | translate([0, back_depth, -height / 2]) |
paul@43 | 746 | linear_extrude(height = back_cavity_height) |
paul@43 | 747 | translate([-int_width / 2, 0, 0]) |
paul@43 | 748 | polygon([ |
paul@43 | 749 | [back_cavity_offset_from_inner_left, 0], |
paul@43 | 750 | [back_cavity_inner_offset_from_inner_left, |
paul@43 | 751 | -back_cavity_depth], |
paul@43 | 752 | [back_cavity_inner_offset_from_inner_left + |
paul@43 | 753 | back_cavity_inner_width, |
paul@43 | 754 | -back_cavity_depth], |
paul@43 | 755 | [back_cavity_offset_from_inner_left + |
paul@43 | 756 | back_cavity_width, 0] |
paul@43 | 757 | ]); |
paul@43 | 758 | |
paul@43 | 759 | /* From left to right. */ |
paul@43 | 760 | |
paul@43 | 761 | translate([back_cavity_width / 2, back_depth, -height / 2]) |
paul@43 | 762 | rotate([0, -90, 0]) |
paul@43 | 763 | linear_extrude(height = back_cavity_width) |
paul@43 | 764 | polygon([ |
paul@43 | 765 | [-extra, -back_cavity_depth], |
paul@43 | 766 | [back_cavity_inner_height, |
paul@43 | 767 | -back_cavity_depth], |
paul@43 | 768 | [back_cavity_height, 0], |
paul@43 | 769 | [-extra, 0] |
paul@43 | 770 | ]); |
paul@43 | 771 | } |
paul@43 | 772 | |
paul@43 | 773 | /* Inner back cavities. */ |
paul@5 | 774 | |
paul@49 | 775 | translate([0, int_connector_back_depth, -height / 2]) |
paul@43 | 776 | linear_extrude(height = int_connector_height) |
paul@43 | 777 | translate([-int_width / 2, 0, 0]) |
paul@43 | 778 | polygon([ |
paul@43 | 779 | [0, 0], |
paul@43 | 780 | [inner_back_slope_max_offset, 0], |
paul@43 | 781 | [inner_back_slope_min_offset, |
paul@43 | 782 | inner_back_slope_depth], |
paul@43 | 783 | [0, inner_back_slope_depth] |
paul@43 | 784 | ]); |
paul@5 | 785 | |
paul@49 | 786 | translate([0, int_connector_back_depth, -height / 2]) |
paul@43 | 787 | linear_extrude(height = int_connector_height) |
paul@43 | 788 | translate([int_width / 2, 0, 0]) |
paul@43 | 789 | polygon([ |
paul@43 | 790 | [0, 0], |
paul@43 | 791 | [-inner_back_slope_max_offset, 0], |
paul@43 | 792 | [-inner_back_slope_min_offset, |
paul@43 | 793 | inner_back_slope_depth], |
paul@43 | 794 | [0, inner_back_slope_depth] |
paul@43 | 795 | ]); |
paul@7 | 796 | |
paul@43 | 797 | /* Inner back edge cavity. */ |
paul@5 | 798 | |
paul@43 | 799 | translate([inner_back_edge_width / 2, |
paul@49 | 800 | int_connector_back_depth + inner_back_edge_depth, -height / 2]) |
paul@43 | 801 | rotate([0, -90, 0]) |
paul@43 | 802 | linear_extrude(height = inner_back_edge_width) |
paul@43 | 803 | polygon([ |
paul@43 | 804 | [-extra, -inner_back_edge_depth], |
paul@43 | 805 | [inner_back_edge_height, -inner_back_edge_depth], |
paul@43 | 806 | [0, 0], |
paul@43 | 807 | [-extra, 0] |
paul@43 | 808 | ]); |
paul@0 | 809 | |
paul@43 | 810 | /* Fillets to round off the edges. */ |
paul@43 | 811 | |
paul@43 | 812 | union() { |
paul@43 | 813 | |
paul@43 | 814 | /* Top left and right rounding. */ |
paul@43 | 815 | |
paul@43 | 816 | translate([-width / 2 + ro, back_depth / 2, height / 2 - ro]) |
paul@43 | 817 | rotate([0, 0, 180]) |
paul@43 | 818 | rotate([90, 0, 0]) |
paul@43 | 819 | fillet(rr, back_depth); |
paul@43 | 820 | translate([width / 2 - ro, back_depth / 2, height / 2 - ro]) |
paul@9 | 821 | rotate([90, 0, 0]) |
paul@9 | 822 | fillet(rr, back_depth); |
paul@43 | 823 | |
paul@43 | 824 | /* Top back rounding. */ |
paul@43 | 825 | |
paul@43 | 826 | translate([0, back_depth - ro, height / 2 - ro]) |
paul@43 | 827 | rotate([0, -90, 0]) |
paul@43 | 828 | fillet(rr, width); |
paul@43 | 829 | |
paul@43 | 830 | /* Edge rounding. */ |
paul@43 | 831 | |
paul@43 | 832 | translate([width / 2 - ro, back_depth - ro, 0]) |
paul@3 | 833 | fillet(rr, height); |
paul@43 | 834 | translate([-width / 2 + ro, back_depth - ro, 0]) |
paul@43 | 835 | rotate([0, 0, 90]) |
paul@43 | 836 | fillet(rr, height); |
paul@46 | 837 | |
paul@46 | 838 | /* Outer edge rounding of the back extension. */ |
paul@46 | 839 | |
paul@46 | 840 | translate([-width / 2 + groove_depth + groove_ro, -groove_width_extra + groove_ro, |
paul@46 | 841 | -height / 2]) |
paul@46 | 842 | rotate([0, 0, 180]) |
paul@46 | 843 | fillet_justified(groove_rr, inner_side_front_cutout_height); |
paul@46 | 844 | |
paul@46 | 845 | translate([width / 2 - groove_depth - groove_ro, -groove_width_extra + groove_ro, |
paul@46 | 846 | -height / 2]) |
paul@46 | 847 | rotate([0, 0, -90]) |
paul@46 | 848 | fillet_justified(groove_rr, inner_side_front_cutout_height); |
paul@46 | 849 | |
paul@46 | 850 | translate([0, -groove_width_extra + groove_ro, |
paul@46 | 851 | int_payload_upper_extent + inner_top_front_cutout_height - groove_ro]) |
paul@46 | 852 | rotate([0, 0, 180]) |
paul@46 | 853 | rotate([0, -90, 0]) |
paul@46 | 854 | fillet(groove_rr, width - groove_depth * 2); |
paul@43 | 855 | } |
paul@0 | 856 | } |
paul@45 | 857 | |
paul@45 | 858 | /* PCB for checking. */ |
paul@45 | 859 | |
paul@45 | 860 | pcb_width = 84.85; pcb_height = 62.5; pcb_depth = 1; |
paul@45 | 861 | edge_connector_width = 56.5; edge_connector_height = 11.85; |
paul@45 | 862 | pcb_position_y = int_payload_lower_extent; |
paul@45 | 863 | |
paul@45 | 864 | pcb_left_hole_offset = pcb_back_support_left_bump_offset_from_bottom |
paul@45 | 865 | + 0.55; |
paul@45 | 866 | pcb_left_hole_width = 2.2; |
paul@45 | 867 | pcb_left_hole_height = pcb_back_support_left_bump_height - 0.55 * 2; |
paul@45 | 868 | pcb_left_hole_offset_from_centre = pcb_support_offset_from_centre + |
paul@45 | 869 | pcb_back_support_width / 2 - pcb_left_hole_width / 2; |
paul@45 | 870 | |
paul@45 | 871 | pcb_right_hole_offset = pcb_back_support_right_bump_offset_from_bottom |
paul@45 | 872 | + 0.55; |
paul@45 | 873 | pcb_right_hole_width = pcb_left_hole_width; |
paul@45 | 874 | pcb_right_hole_height = pcb_back_support_right_bump_height - 0.55 * 2; |
paul@45 | 875 | pcb_right_hole_offset_from_centre = -pcb_left_hole_offset_from_centre; |
paul@45 | 876 | |
paul@45 | 877 | pcb_hole_depth = pcb_depth + 0.2; |
paul@45 | 878 | pcb_hole_start_depth = -0.1; |
paul@45 | 879 | pcb_lug_hole_radius = 3.75; |
paul@45 | 880 | |
paul@45 | 881 | if (PCB) |
paul@45 | 882 | translate([back_displacement, 0, 0]) |
paul@45 | 883 | translate([0, 0, pcb_position_y]) |
paul@45 | 884 | difference() { |
paul@45 | 885 | |
paul@45 | 886 | /* Mock PCB. */ |
paul@45 | 887 | |
paul@45 | 888 | union() { |
paul@45 | 889 | cube_at(pcb_width, pcb_depth, |
paul@45 | 890 | pcb_height - edge_connector_height, |
paul@45 | 891 | 0, 1, 1, |
paul@45 | 892 | 0, 0, 0); |
paul@45 | 893 | cube_at(edge_connector_width, pcb_depth, |
paul@45 | 894 | edge_connector_height, |
paul@45 | 895 | 0, 1, -1, |
paul@45 | 896 | 0, 0, 0); |
paul@45 | 897 | } |
paul@45 | 898 | |
paul@45 | 899 | /* Holes for mounting. */ |
paul@45 | 900 | |
paul@45 | 901 | union() { |
paul@45 | 902 | cube_at(pcb_left_hole_width, 1, pcb_left_hole_height, |
paul@45 | 903 | 1, 1, 1, |
paul@45 | 904 | pcb_left_hole_offset_from_centre, 0, pcb_left_hole_offset); |
paul@45 | 905 | translate([pcb_left_hole_offset_from_centre + |
paul@45 | 906 | pcb_left_hole_width / 2, pcb_hole_start_depth, pcb_left_hole_offset]) |
paul@45 | 907 | rotate([-90, 0, 0]) |
paul@45 | 908 | cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2); |
paul@45 | 909 | translate([pcb_left_hole_offset_from_centre + |
paul@45 | 910 | pcb_left_hole_width / 2, pcb_hole_start_depth, |
paul@45 | 911 | pcb_left_hole_offset + pcb_left_hole_height]) |
paul@45 | 912 | rotate([-90, 0, 0]) |
paul@45 | 913 | cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2); |
paul@45 | 914 | } |
paul@45 | 915 | |
paul@45 | 916 | union() { |
paul@45 | 917 | cube_at(pcb_right_hole_width, 1, pcb_right_hole_height, |
paul@45 | 918 | -1, 1, 1, |
paul@45 | 919 | pcb_right_hole_offset_from_centre, 0, pcb_right_hole_offset); |
paul@45 | 920 | translate([pcb_right_hole_offset_from_centre - |
paul@45 | 921 | pcb_right_hole_width / 2, pcb_hole_start_depth, pcb_right_hole_offset]) |
paul@45 | 922 | rotate([-90, 0, 0]) |
paul@45 | 923 | cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2); |
paul@45 | 924 | translate([pcb_right_hole_offset_from_centre - |
paul@45 | 925 | pcb_right_hole_width / 2, pcb_hole_start_depth, |
paul@45 | 926 | pcb_right_hole_offset + pcb_right_hole_height]) |
paul@45 | 927 | rotate([-90, 0, 0]) |
paul@45 | 928 | cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2); |
paul@45 | 929 | } |
paul@45 | 930 | |
paul@45 | 931 | /* Holes for lugs. */ |
paul@45 | 932 | |
paul@45 | 933 | translate([ |
paul@45 | 934 | -int_width / 2 + pcb_lug_offset_from_inside, |
paul@45 | 935 | pcb_hole_start_depth, pcb_lug_offset_from_bottom]) |
paul@45 | 936 | rotate([-90, 0, 0]) |
paul@45 | 937 | cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius); |
paul@45 | 938 | |
paul@45 | 939 | translate([ |
paul@45 | 940 | int_width / 2 - pcb_lug_offset_from_inside, |
paul@45 | 941 | pcb_hole_start_depth, pcb_lug_offset_from_bottom]) |
paul@45 | 942 | rotate([-90, 0, 0]) |
paul@45 | 943 | cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius); |
paul@45 | 944 | } |
paul@0 | 945 | } |
paul@0 | 946 | |
paul@38 | 947 | cartridge(); |