1.1 --- a/cartridge.scad Fri Apr 08 21:01:36 2016 +0200
1.2 +++ b/cartridge.scad Sun Apr 10 16:45:18 2016 +0200
1.3 @@ -24,16 +24,24 @@
1.4 ROM_CARTRIDGE = 0;
1.5 WIDE_CARTRIDGE = 1;
1.6
1.7 + /* Set this to the desired model type. */
1.8 +
1.9 + MODEL = ROM_CARTRIDGE;
1.10 +
1.11 /*
1.12 Configure the generated shapes.
1.13 For the absolute simplest shape (for basic 3D printers)...
1.14
1.15 - BACK_CAVITY = 1; FRONT_LABEL_INSET = 0; TOP_LABEL_INSET = 0;
1.16 + BACK_CONNECTOR_SECTION = 0;
1.17 + FRONT_LABEL_INSET = 0; TOP_LABEL_INSET = 0;
1.18 GROOVE = 0; ROUND_EDGES = 0; ROUND_CONNECTING_EDGES = 0
1.19
1.20 Leave all options enabled for more capable 3D printers.
1.21 */
1.22
1.23 + /* The back part of the connecting section of the cartridge. */
1.24 + BACK_CONNECTOR_SECTION = 1;
1.25 +
1.26 /* A necessary exterior cavity to let the cartridge fit inside the slot. */
1.27 BACK_CAVITY = 1;
1.28
1.29 @@ -50,10 +58,6 @@
1.30 /* Recommended rounding of connection edges. */
1.31 ROUND_CONNECTING_EDGES = 1;
1.32
1.33 - /* Set this to the desired model type. */
1.34 -
1.35 - MODEL = ROM_CARTRIDGE;
1.36 -
1.37 /* Set this where a shorter PCB is to be used. */
1.38
1.39 SHORT_PCB = 0;
1.40 @@ -757,17 +761,22 @@
1.41 -1, -1, 1,
1.42 int_payload_left_extent, 0, int_payload_lower_extent);
1.43
1.44 - cube_at(inner_connector_front_cutout_width,
1.45 - inner_connector_front_cutout_depth,
1.46 - inner_connector_front_cutout_height,
1.47 - 1, -1, -1,
1.48 - int_connector_width / 2, 0, int_payload_lower_extent);
1.49 + if (BACK_CONNECTOR_SECTION) {
1.50 +
1.51 + /* Cutout to accept the back connector sides. */
1.52
1.53 - cube_at(inner_connector_front_cutout_width,
1.54 - inner_connector_front_cutout_depth,
1.55 - inner_connector_front_cutout_height,
1.56 - -1, -1, -1,
1.57 - -int_connector_width / 2, 0, int_payload_lower_extent);
1.58 + cube_at(inner_connector_front_cutout_width,
1.59 + inner_connector_front_cutout_depth,
1.60 + inner_connector_front_cutout_height,
1.61 + 1, -1, -1,
1.62 + int_connector_width / 2, 0, int_payload_lower_extent);
1.63 +
1.64 + cube_at(inner_connector_front_cutout_width,
1.65 + inner_connector_front_cutout_depth,
1.66 + inner_connector_front_cutout_height,
1.67 + -1, -1, -1,
1.68 + -int_connector_width / 2, 0, int_payload_lower_extent);
1.69 + }
1.70
1.71 /* Fillets to round off the edges. */
1.72
1.73 @@ -853,17 +862,19 @@
1.74
1.75 /* Connector section of back surface overlapping the floor. */
1.76
1.77 - cube_at(connector_width, connector_back, connector_height,
1.78 - 0, 1, -1,
1.79 - 0, int_connector_back_depth, int_payload_lower_extent);
1.80 + if (BACK_CONNECTOR_SECTION) {
1.81 + cube_at(connector_width, connector_back, connector_height,
1.82 + 0, 1, -1,
1.83 + 0, int_connector_back_depth, int_payload_lower_extent);
1.84
1.85 - cube_at(back_left, back_depth, connector_height,
1.86 - -1, 1, -1,
1.87 - -int_connector_width / 2, 0, int_payload_lower_extent);
1.88 + cube_at(back_left, back_depth, connector_height,
1.89 + -1, 1, -1,
1.90 + -int_connector_width / 2, 0, int_payload_lower_extent);
1.91
1.92 - cube_at(back_right, back_depth, connector_height,
1.93 - 1, 1, -1,
1.94 - int_connector_width / 2, 0, int_payload_lower_extent);
1.95 + cube_at(back_right, back_depth, connector_height,
1.96 + 1, 1, -1,
1.97 + int_connector_width / 2, 0, int_payload_lower_extent);
1.98 + }
1.99
1.100 /* Top of back piece. */
1.101
1.102 @@ -907,30 +918,35 @@
1.103 fillet_justified(groove_rr, inner_payload_front_cutout_height);
1.104 }
1.105
1.106 - /* Left side of connector. */
1.107 + if (BACK_CONNECTOR_SECTION) {
1.108 +
1.109 + /* Left side of connector. */
1.110
1.111 - difference() {
1.112 - cube_at(back_left - groove_depth, groove_width_extra, inner_connector_front_cutout_height,
1.113 - -1, 1, -1,
1.114 - -int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.115 - if (ROUND_CONNECTING_EDGES)
1.116 - translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro,
1.117 - lower_extent])
1.118 - rotate([0, 0, -90])
1.119 - fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra);
1.120 - }
1.121 + difference() {
1.122 + cube_at(back_left - groove_depth, groove_width_extra, inner_connector_front_cutout_height,
1.123 + -1, 1, -1,
1.124 + -int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.125 + if (ROUND_CONNECTING_EDGES)
1.126 + translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro,
1.127 + lower_extent])
1.128 + rotate([0, 0, -90])
1.129 + fillet_partitioned(groove_rr,
1.130 + inner_connector_front_cutout_height + extra);
1.131 + }
1.132
1.133 - /* Right side of connector. */
1.134 + /* Right side of connector. */
1.135
1.136 - difference() {
1.137 - cube_at(back_right - groove_depth, groove_width_extra, inner_connector_front_cutout_height,
1.138 - 1, 1, -1,
1.139 - int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.140 - if (ROUND_CONNECTING_EDGES)
1.141 - translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro,
1.142 - lower_extent])
1.143 - rotate([0, 0, 180])
1.144 - fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra);
1.145 + difference() {
1.146 + cube_at(back_right - groove_depth, groove_width_extra, inner_connector_front_cutout_height,
1.147 + 1, 1, -1,
1.148 + int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.149 + if (ROUND_CONNECTING_EDGES)
1.150 + translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro,
1.151 + lower_extent])
1.152 + rotate([0, 0, 180])
1.153 + fillet_partitioned(groove_rr,
1.154 + inner_connector_front_cutout_height + extra);
1.155 + }
1.156 }
1.157
1.158 /* Top side. */
1.159 @@ -952,7 +968,7 @@
1.160
1.161 /* Floor of cartridge. */
1.162
1.163 - cube_at(int_connector_width, int_connector_back_depth, bottom,
1.164 + cube_at(connector_width, back_depth, bottom,
1.165 0, 1, 1,
1.166 0, 0, lower_extent + int_connector_height);
1.167
1.168 @@ -1043,77 +1059,80 @@
1.169 payload_centre, -groove_width_extra, upper_extent);
1.170 }
1.171
1.172 - /* Back cavity. */
1.173 + if (BACK_CONNECTOR_SECTION) {
1.174 +
1.175 + /* Back cavity. */
1.176
1.177 - if (BACK_CAVITY)
1.178 - intersection() {
1.179 + if (BACK_CAVITY)
1.180 + intersection() {
1.181
1.182 - /* From the bottom upwards. */
1.183 + /* From the bottom upwards. */
1.184
1.185 - translate([0, back_depth, lower_extent])
1.186 - linear_extrude(height = back_cavity_height)
1.187 - translate([-int_connector_width / 2, 0, 0])
1.188 - polygon([
1.189 - [back_cavity_offset_from_inner_left, 0],
1.190 - [back_cavity_inner_offset_from_inner_left,
1.191 - -back_cavity_depth],
1.192 - [back_cavity_inner_offset_from_inner_left +
1.193 - back_cavity_inner_width,
1.194 - -back_cavity_depth],
1.195 - [back_cavity_offset_from_inner_left +
1.196 - back_cavity_width, 0]
1.197 - ]);
1.198 + translate([0, back_depth, lower_extent])
1.199 + linear_extrude(height = back_cavity_height)
1.200 + translate([-int_connector_width / 2, 0, 0])
1.201 + polygon([
1.202 + [back_cavity_offset_from_inner_left, 0],
1.203 + [back_cavity_inner_offset_from_inner_left,
1.204 + -back_cavity_depth],
1.205 + [back_cavity_inner_offset_from_inner_left +
1.206 + back_cavity_inner_width,
1.207 + -back_cavity_depth],
1.208 + [back_cavity_offset_from_inner_left +
1.209 + back_cavity_width, 0]
1.210 + ]);
1.211
1.212 - /* From left to right. */
1.213 + /* From left to right. */
1.214
1.215 - translate([back_cavity_width / 2, back_depth, lower_extent])
1.216 - rotate([0, -90, 0])
1.217 - linear_extrude(height = back_cavity_width)
1.218 - polygon([
1.219 - [-extra, -back_cavity_depth],
1.220 - [back_cavity_inner_height,
1.221 - -back_cavity_depth],
1.222 - [back_cavity_height, 0],
1.223 - [-extra, 0]
1.224 - ]);
1.225 - }
1.226 + translate([back_cavity_width / 2, back_depth, lower_extent])
1.227 + rotate([0, -90, 0])
1.228 + linear_extrude(height = back_cavity_width)
1.229 + polygon([
1.230 + [-extra, -back_cavity_depth],
1.231 + [back_cavity_inner_height,
1.232 + -back_cavity_depth],
1.233 + [back_cavity_height, 0],
1.234 + [-extra, 0]
1.235 + ]);
1.236 + }
1.237
1.238 - /* Inner back cavities. */
1.239 + /* Inner back cavities. */
1.240
1.241 - translate([0, int_connector_back_depth, lower_extent])
1.242 - linear_extrude(height = int_connector_height)
1.243 - translate([-int_connector_width / 2, 0, 0])
1.244 - polygon([
1.245 - [0, 0],
1.246 - [inner_back_slope_max_offset, 0],
1.247 - [inner_back_slope_min_offset,
1.248 - inner_back_slope_depth],
1.249 - [0, inner_back_slope_depth]
1.250 - ]);
1.251 + translate([0, int_connector_back_depth, lower_extent])
1.252 + linear_extrude(height = int_connector_height)
1.253 + translate([-int_connector_width / 2, 0, 0])
1.254 + polygon([
1.255 + [0, 0],
1.256 + [inner_back_slope_max_offset, 0],
1.257 + [inner_back_slope_min_offset,
1.258 + inner_back_slope_depth],
1.259 + [0, inner_back_slope_depth]
1.260 + ]);
1.261
1.262 - translate([0, int_connector_back_depth, lower_extent])
1.263 - linear_extrude(height = int_connector_height)
1.264 - translate([int_connector_width / 2, 0, 0])
1.265 - polygon([
1.266 - [0, 0],
1.267 - [-inner_back_slope_max_offset, 0],
1.268 - [-inner_back_slope_min_offset,
1.269 - inner_back_slope_depth],
1.270 - [0, inner_back_slope_depth]
1.271 - ]);
1.272 + translate([0, int_connector_back_depth, lower_extent])
1.273 + linear_extrude(height = int_connector_height)
1.274 + translate([int_connector_width / 2, 0, 0])
1.275 + polygon([
1.276 + [0, 0],
1.277 + [-inner_back_slope_max_offset, 0],
1.278 + [-inner_back_slope_min_offset,
1.279 + inner_back_slope_depth],
1.280 + [0, inner_back_slope_depth]
1.281 + ]);
1.282
1.283 - /* Inner back edge cavity. */
1.284 + /* Inner back edge cavity. */
1.285
1.286 - translate([inner_back_edge_width / 2,
1.287 - int_connector_back_depth + inner_back_edge_depth, lower_extent])
1.288 - rotate([0, -90, 0])
1.289 - linear_extrude(height = inner_back_edge_width)
1.290 - polygon([
1.291 - [-extra, -inner_back_edge_depth],
1.292 - [inner_back_edge_height, -inner_back_edge_depth],
1.293 - [0, 0],
1.294 - [-extra, 0]
1.295 - ]);
1.296 + translate([inner_back_edge_width / 2,
1.297 + int_connector_back_depth + inner_back_edge_depth, lower_extent])
1.298 + rotate([0, -90, 0])
1.299 + linear_extrude(height = inner_back_edge_width)
1.300 + polygon([
1.301 + [-extra, -inner_back_edge_depth],
1.302 + [inner_back_edge_height, -inner_back_edge_depth],
1.303 + [0, 0],
1.304 + [-extra, 0]
1.305 + ]);
1.306 + }
1.307
1.308 /* Fillets to round off the edges. */
1.309
1.310 @@ -1145,12 +1164,14 @@
1.311 rotate([0, 0, 90])
1.312 fillet_justified(rr, payload_height + bottom + extra);
1.313
1.314 - translate([connector_width / 2 - ro, back_depth - ro, lower_extent])
1.315 - fillet_partitioned(rr, connector_height - bottom);
1.316 + if (BACK_CONNECTOR_SECTION) {
1.317 + translate([connector_width / 2 - ro, back_depth - ro, lower_extent])
1.318 + fillet_partitioned(rr, connector_height - bottom);
1.319
1.320 - translate([-connector_width / 2 + ro, back_depth - ro, lower_extent])
1.321 - rotate([0, 0, 90])
1.322 - fillet_partitioned(rr, connector_height - bottom);
1.323 + translate([-connector_width / 2 + ro, back_depth - ro, lower_extent])
1.324 + rotate([0, 0, 90])
1.325 + fillet_partitioned(rr, connector_height - bottom);
1.326 + }
1.327 }
1.328
1.329 if (ROUND_CONNECTING_EDGES) {