1.1 --- a/cartridge.scad Thu Dec 11 18:48:02 2014 +0100
1.2 +++ b/cartridge.scad Thu Dec 11 19:28:09 2014 +0100
1.3 @@ -182,8 +182,10 @@
1.4 connector_height = bottom + int_connector_height;
1.5 height = payload_height + bottom + int_connector_height;
1.6 depth = int_payload_depth + front + payload_back;
1.7 - int_payload_upper_extent = height / 2 - top;
1.8 - int_payload_lower_extent = -height / 2 + int_connector_height + bottom;
1.9 + upper_extent = height / 2;
1.10 + lower_extent = -upper_extent;
1.11 + int_payload_upper_extent = upper_extent - top;
1.12 + int_payload_lower_extent = lower_extent + int_connector_height + bottom;
1.13
1.14 /* Where the payload is wider than the connector, the payload expands to the left. */
1.15
1.16 @@ -505,7 +507,7 @@
1.17
1.18 cube_at(int_connector_width, int_front_depth, bottom,
1.19 0, -1, 1,
1.20 - 0, 0, -height / 2 + int_connector_height);
1.21 + 0, 0, lower_extent + int_connector_height);
1.22
1.23 /* Left cutout. */
1.24
1.25 @@ -515,7 +517,7 @@
1.26 1, -1, 1,
1.27 -int_connector_width / 2,
1.28 0,
1.29 - -height / 2 + int_connector_height);
1.30 + lower_extent + int_connector_height);
1.31
1.32 /* Right cutout. */
1.33
1.34 @@ -525,7 +527,7 @@
1.35 -1, -1, 1,
1.36 int_connector_width / 2,
1.37 0,
1.38 - -height / 2 + int_connector_height);
1.39 + lower_extent + int_connector_height);
1.40 }
1.41
1.42 /* Extended floor. */
1.43 @@ -534,7 +536,7 @@
1.44
1.45 cube_at(payload_width - connector_width, front_depth, bottom,
1.46 1, -1, 1,
1.47 - payload_left_extent, 0, -height / 2 + int_connector_height);
1.48 + payload_left_extent, 0, lower_extent + int_connector_height);
1.49 }
1.50
1.51 /* PCB supports. */
1.52 @@ -571,7 +573,7 @@
1.53
1.54 if (FRONT_LABEL_INSET)
1.55 translate([front_label_left_extent, -front_depth,
1.56 - front_label_offset_from_bottom - height / 2])
1.57 + lower_extent + front_label_offset_from_bottom])
1.58 cube([front_label_width, front_label_depth,
1.59 front_label_height]);
1.60
1.61 @@ -580,14 +582,14 @@
1.62 if (TOP_LABEL_INSET)
1.63 translate([top_label_left_extent,
1.64 -front_depth + top_label_offset_from_front,
1.65 - height / 2 - top_label_depth])
1.66 + upper_extent - top_label_depth])
1.67 cube([top_label_width, top_label_height,
1.68 top_label_depth]);
1.69 }
1.70
1.71 /* Inner front edge cavity. */
1.72
1.73 - translate([inner_front_edge_width / 2, -int_front_depth, -height / 2])
1.74 + translate([inner_front_edge_width / 2, -int_front_depth, lower_extent])
1.75 rotate([0, -90, 0])
1.76 linear_extrude(height = inner_front_edge_width)
1.77 polygon([
1.78 @@ -635,17 +637,17 @@
1.79
1.80 /* Top left and right rounding. */
1.81
1.82 - translate([payload_left_extent + ro, -front_depth / 2, height / 2 - ro])
1.83 + translate([payload_left_extent + ro, -front_depth / 2, upper_extent - ro])
1.84 rotate([0, 0, 180])
1.85 rotate([90, 0, 0])
1.86 fillet(rr, front_depth);
1.87 - translate([payload_right_extent - ro, -front_depth / 2, height / 2 - ro])
1.88 + translate([payload_right_extent - ro, -front_depth / 2, upper_extent - ro])
1.89 rotate([90, 0, 0])
1.90 fillet(rr, front_depth);
1.91
1.92 /* Top front rounding. */
1.93
1.94 - translate([payload_centre, -front_depth + ro, height / 2 - ro])
1.95 + translate([payload_centre, -front_depth + ro, upper_extent - ro])
1.96 rotate([0, 0, 180])
1.97 rotate([0, -90, 0])
1.98 fillet(rr, payload_width);
1.99 @@ -660,11 +662,11 @@
1.100 rotate([0, 0, 180])
1.101 fillet_justified(rr, payload_height + bottom + extra);
1.102
1.103 - translate([connector_width / 2 - ro, -front_depth + ro, -height / 2])
1.104 + translate([connector_width / 2 - ro, -front_depth + ro, lower_extent])
1.105 rotate([0, 0, 270])
1.106 fillet_partitioned(rr, connector_height - bottom);
1.107
1.108 - translate([-connector_width / 2 + ro, -front_depth + ro, -height / 2])
1.109 + translate([-connector_width / 2 + ro, -front_depth + ro, lower_extent])
1.110 rotate([0, 0, 180])
1.111 fillet_partitioned(rr, connector_height - bottom);
1.112 }
1.113 @@ -769,7 +771,7 @@
1.114 -1, 1, -1,
1.115 -int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.116 translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro,
1.117 - -height / 2])
1.118 + lower_extent])
1.119 rotate([0, 0, -90])
1.120 fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra);
1.121 }
1.122 @@ -781,7 +783,7 @@
1.123 1, 1, -1,
1.124 int_connector_width / 2, -groove_width_extra, int_payload_lower_extent);
1.125 translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro,
1.126 - -height / 2])
1.127 + lower_extent])
1.128 rotate([0, 0, 180])
1.129 fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra);
1.130 }
1.131 @@ -806,7 +808,7 @@
1.132
1.133 cube_at(int_connector_width, int_connector_back_depth, bottom,
1.134 0, 1, 1,
1.135 - 0, 0, -height / 2 + int_connector_height);
1.136 + 0, 0, lower_extent + int_connector_height);
1.137
1.138 /* Edge connector cutout. */
1.139
1.140 @@ -814,7 +816,7 @@
1.141 edge_connector_cutout_back_depth,
1.142 bottom,
1.143 0, 1, 1,
1.144 - 0, 0, -height / 2 + int_connector_height);
1.145 + 0, 0, lower_extent + int_connector_height);
1.146 }
1.147
1.148 /* Extended floor. */
1.149 @@ -825,11 +827,11 @@
1.150
1.151 cube_at(payload_width - connector_width, back_depth, bottom,
1.152 1, 1, 1,
1.153 - payload_left_extent, 0, -height / 2 + int_connector_height);
1.154 + payload_left_extent, 0, lower_extent + int_connector_height);
1.155
1.156 cube_at(payload_width - connector_width, edge_connector_cutout_front_depth, bottom,
1.157 1, 1, 1,
1.158 - payload_left_extent, 0, -height / 2 + int_connector_height);
1.159 + payload_left_extent, 0, lower_extent + int_connector_height);
1.160 }
1.161 }
1.162
1.163 @@ -857,7 +859,7 @@
1.164 if (TOP_LABEL_INSET)
1.165 translate([top_label_left_extent,
1.166 -front_depth + top_label_offset_from_front,
1.167 - height / 2 - top_label_depth])
1.168 + upper_extent - top_label_depth])
1.169 cube([top_label_width, top_label_height,
1.170 top_label_depth]);
1.171 }
1.172 @@ -882,11 +884,11 @@
1.173
1.174 cube_at(payload_width, groove_width_normal, groove_depth,
1.175 0, 1, -1,
1.176 - payload_centre, 0, height / 2);
1.177 + payload_centre, 0, upper_extent);
1.178
1.179 cube_at(payload_width, top_groove_width, top_groove_depth,
1.180 0, 1, -1,
1.181 - payload_centre, -groove_width_extra, height / 2);
1.182 + payload_centre, -groove_width_extra, upper_extent);
1.183 }
1.184
1.185 /* Back cavity. */
1.186 @@ -896,7 +898,7 @@
1.187
1.188 /* From the bottom upwards. */
1.189
1.190 - translate([0, back_depth, -height / 2])
1.191 + translate([0, back_depth, lower_extent])
1.192 linear_extrude(height = back_cavity_height)
1.193 translate([-int_connector_width / 2, 0, 0])
1.194 polygon([
1.195 @@ -912,7 +914,7 @@
1.196
1.197 /* From left to right. */
1.198
1.199 - translate([back_cavity_width / 2, back_depth, -height / 2])
1.200 + translate([back_cavity_width / 2, back_depth, lower_extent])
1.201 rotate([0, -90, 0])
1.202 linear_extrude(height = back_cavity_width)
1.203 polygon([
1.204 @@ -926,7 +928,7 @@
1.205
1.206 /* Inner back cavities. */
1.207
1.208 - translate([0, int_connector_back_depth, -height / 2])
1.209 + translate([0, int_connector_back_depth, lower_extent])
1.210 linear_extrude(height = int_connector_height)
1.211 translate([-int_connector_width / 2, 0, 0])
1.212 polygon([
1.213 @@ -937,7 +939,7 @@
1.214 [0, inner_back_slope_depth]
1.215 ]);
1.216
1.217 - translate([0, int_connector_back_depth, -height / 2])
1.218 + translate([0, int_connector_back_depth, lower_extent])
1.219 linear_extrude(height = int_connector_height)
1.220 translate([int_connector_width / 2, 0, 0])
1.221 polygon([
1.222 @@ -951,7 +953,7 @@
1.223 /* Inner back edge cavity. */
1.224
1.225 translate([inner_back_edge_width / 2,
1.226 - int_connector_back_depth + inner_back_edge_depth, -height / 2])
1.227 + int_connector_back_depth + inner_back_edge_depth, lower_extent])
1.228 rotate([0, -90, 0])
1.229 linear_extrude(height = inner_back_edge_width)
1.230 polygon([
1.231 @@ -967,17 +969,17 @@
1.232
1.233 /* Top left and right rounding. */
1.234
1.235 - translate([payload_left_extent + ro, back_depth / 2, height / 2 - ro])
1.236 + translate([payload_left_extent + ro, back_depth / 2, upper_extent - ro])
1.237 rotate([0, 0, 180])
1.238 rotate([90, 0, 0])
1.239 fillet(rr, back_depth);
1.240 - translate([payload_right_extent - ro, back_depth / 2, height / 2 - ro])
1.241 + translate([payload_right_extent - ro, back_depth / 2, upper_extent - ro])
1.242 rotate([90, 0, 0])
1.243 fillet(rr, back_depth);
1.244
1.245 /* Top back rounding. */
1.246
1.247 - translate([payload_centre, back_depth - ro, height / 2 - ro])
1.248 + translate([payload_centre, back_depth - ro, upper_extent - ro])
1.249 rotate([0, -90, 0])
1.250 fillet(rr, payload_width);
1.251
1.252 @@ -990,10 +992,10 @@
1.253 rotate([0, 0, 90])
1.254 fillet_justified(rr, payload_height + bottom + extra);
1.255
1.256 - translate([connector_width / 2 - ro, back_depth - ro, -height / 2])
1.257 + translate([connector_width / 2 - ro, back_depth - ro, lower_extent])
1.258 fillet_partitioned(rr, connector_height - bottom);
1.259
1.260 - translate([-connector_width / 2 + ro, back_depth - ro, -height / 2])
1.261 + translate([-connector_width / 2 + ro, back_depth - ro, lower_extent])
1.262 rotate([0, 0, 90])
1.263 fillet_partitioned(rr, connector_height - bottom);
1.264
1.265 @@ -1020,12 +1022,12 @@
1.266 /* Sides of connector. */
1.267
1.268 translate([-connector_width / 2 + groove_depth + groove_ro, -groove_width_extra + groove_ro,
1.269 - -height / 2])
1.270 + lower_extent])
1.271 rotate([0, 0, 180])
1.272 fillet_partitioned(groove_rr, inner_connector_front_cutout_height);
1.273
1.274 translate([connector_width / 2 - groove_depth - groove_ro, -groove_width_extra + groove_ro,
1.275 - -height / 2])
1.276 + lower_extent])
1.277 rotate([0, 0, -90])
1.278 fillet_partitioned(groove_rr, inner_connector_front_cutout_height);
1.279