1.1 --- a/cartridge.scad Sun Dec 07 00:49:12 2014 +0100
1.2 +++ b/cartridge.scad Thu Dec 11 18:48:02 2014 +0100
1.3 @@ -26,6 +26,10 @@
1.4 TOP_LABEL_INSET = 1;
1.5 GROOVE = 1;
1.6
1.7 + /* Model configurations. */
1.8 +
1.9 + ROM_CARTRIDGE = 1;
1.10 +
1.11 /*
1.12 Options for checking. Some useful combinations...
1.13
1.14 @@ -535,26 +539,28 @@
1.15
1.16 /* PCB supports. */
1.17
1.18 - cube_at(pcb_front_support_width,
1.19 - pcb_front_support_depth,
1.20 - pcb_front_support_height,
1.21 - -1, -1, 1,
1.22 - -pcb_support_offset_from_centre,
1.23 - 0,
1.24 - int_payload_lower_extent);
1.25 + if (ROM_CARTRIDGE) {
1.26 + cube_at(pcb_front_support_width,
1.27 + pcb_front_support_depth,
1.28 + pcb_front_support_height,
1.29 + -1, -1, 1,
1.30 + -pcb_support_offset_from_centre,
1.31 + 0,
1.32 + int_payload_lower_extent);
1.33
1.34 - cube_at(pcb_front_support_width,
1.35 - pcb_front_support_depth,
1.36 - pcb_front_support_height,
1.37 - 1, -1, 1,
1.38 - pcb_support_offset_from_centre,
1.39 - 0,
1.40 - int_payload_lower_extent);
1.41 + cube_at(pcb_front_support_width,
1.42 + pcb_front_support_depth,
1.43 + pcb_front_support_height,
1.44 + 1, -1, 1,
1.45 + pcb_support_offset_from_centre,
1.46 + 0,
1.47 + int_payload_lower_extent);
1.48
1.49 - /* Circular "lugs" to hold PCBs in place. */
1.50 + /* Circular "lugs" to hold PCBs in place. */
1.51
1.52 - pcb_front_lug(-1);
1.53 - pcb_front_lug(1);
1.54 + pcb_front_lug(-1);
1.55 + pcb_front_lug(1);
1.56 + }
1.57 }
1.58
1.59 /* Label insets. */
1.60 @@ -829,15 +835,17 @@
1.61
1.62 /* PCB supports. */
1.63
1.64 - pcb_support(-1, pcb_back_support_left_bump_height,
1.65 - pcb_back_support_left_bump_offset_from_bottom);
1.66 - pcb_support(1, pcb_back_support_right_bump_height,
1.67 - pcb_back_support_right_bump_offset_from_bottom);
1.68 + if (ROM_CARTRIDGE) {
1.69 + pcb_support(-1, pcb_back_support_left_bump_height,
1.70 + pcb_back_support_left_bump_offset_from_bottom);
1.71 + pcb_support(1, pcb_back_support_right_bump_height,
1.72 + pcb_back_support_right_bump_offset_from_bottom);
1.73
1.74 - /* Circular "lugs" to hold PCBs in place. */
1.75 + /* Circular "lugs" to hold PCBs in place. */
1.76
1.77 - pcb_lug(-1);
1.78 - pcb_lug(1);
1.79 + pcb_lug(-1);
1.80 + pcb_lug(1);
1.81 + }
1.82 }
1.83
1.84 /* Label insets. */
1.85 @@ -1037,26 +1045,33 @@
1.86 edge_connector_width = 56.5; edge_connector_height = 11.85;
1.87 pcb_position_y = int_payload_lower_extent;
1.88
1.89 - pcb_left_hole_offset = pcb_back_support_left_bump_offset_from_bottom
1.90 - + 0.55;
1.91 - pcb_left_hole_width = 2.2;
1.92 - pcb_left_hole_height = pcb_back_support_left_bump_height - 0.55 * 2;
1.93 + /*
1.94 + The rectangular part of the narrow left and right holes is smaller
1.95 + than the "bump" in the case, but the circular parts make the overall
1.96 + hole larger than the "bump". An extra depth is used for holes to avoid
1.97 + surface definition problems.
1.98 + */
1.99 +
1.100 + pcb_hole_margin = 0.55;
1.101 + pcb_hole_width = 2.2;
1.102 + pcb_hole_extra_depth = 0.1;
1.103 + pcb_lug_hole_radius = 3.75;
1.104 +
1.105 + pcb_left_hole_offset = pcb_back_support_left_bump_offset_from_bottom + pcb_hole_margin;
1.106 + pcb_left_hole_height = pcb_back_support_left_bump_height - pcb_hole_margin * 2;
1.107 pcb_left_hole_offset_from_centre = pcb_support_offset_from_centre +
1.108 - pcb_back_support_width / 2 - pcb_left_hole_width / 2;
1.109 + pcb_back_support_width / 2 - pcb_hole_width / 2;
1.110
1.111 - pcb_right_hole_offset = pcb_back_support_right_bump_offset_from_bottom
1.112 - + 0.55;
1.113 - pcb_right_hole_width = pcb_left_hole_width;
1.114 - pcb_right_hole_height = pcb_back_support_right_bump_height - 0.55 * 2;
1.115 + pcb_right_hole_offset = pcb_back_support_right_bump_offset_from_bottom + pcb_hole_margin;
1.116 + pcb_right_hole_height = pcb_back_support_right_bump_height - pcb_hole_margin * 2;
1.117 pcb_right_hole_offset_from_centre = -pcb_left_hole_offset_from_centre;
1.118
1.119 - pcb_hole_depth = pcb_depth + 0.2;
1.120 - pcb_hole_start_depth = -0.1;
1.121 - pcb_lug_hole_radius = 3.75;
1.122 + pcb_hole_depth = pcb_depth + 2 * pcb_hole_extra_depth;
1.123 + pcb_hole_start_depth = -pcb_hole_extra_depth;
1.124
1.125 - if (PCB)
1.126 + if (PCB) if (ROM_CARTRIDGE) {
1.127 translate([back_displacement, 0, 0])
1.128 - translate([0, 0, pcb_position_y])
1.129 + translate([0, 0, pcb_position_y])
1.130 difference() {
1.131
1.132 /* Mock PCB. */
1.133 @@ -1075,33 +1090,33 @@
1.134 /* Holes for mounting. */
1.135
1.136 union() {
1.137 - cube_at(pcb_left_hole_width, 1, pcb_left_hole_height,
1.138 + cube_at(pcb_hole_width, 1, pcb_left_hole_height,
1.139 1, 1, 1,
1.140 pcb_left_hole_offset_from_centre, 0, pcb_left_hole_offset);
1.141 translate([pcb_left_hole_offset_from_centre +
1.142 - pcb_left_hole_width / 2, pcb_hole_start_depth, pcb_left_hole_offset])
1.143 + pcb_hole_width / 2, pcb_hole_start_depth, pcb_left_hole_offset])
1.144 rotate([-90, 0, 0])
1.145 - cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2);
1.146 + cylinder(h=pcb_hole_depth, r=pcb_hole_width / 2);
1.147 translate([pcb_left_hole_offset_from_centre +
1.148 - pcb_left_hole_width / 2, pcb_hole_start_depth,
1.149 + pcb_hole_width / 2, pcb_hole_start_depth,
1.150 pcb_left_hole_offset + pcb_left_hole_height])
1.151 rotate([-90, 0, 0])
1.152 - cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2);
1.153 + cylinder(h=pcb_hole_depth, r=pcb_hole_width / 2);
1.154 }
1.155
1.156 union() {
1.157 - cube_at(pcb_right_hole_width, 1, pcb_right_hole_height,
1.158 + cube_at(pcb_hole_width, 1, pcb_right_hole_height,
1.159 -1, 1, 1,
1.160 pcb_right_hole_offset_from_centre, 0, pcb_right_hole_offset);
1.161 translate([pcb_right_hole_offset_from_centre -
1.162 - pcb_right_hole_width / 2, pcb_hole_start_depth, pcb_right_hole_offset])
1.163 + pcb_hole_width / 2, pcb_hole_start_depth, pcb_right_hole_offset])
1.164 rotate([-90, 0, 0])
1.165 - cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2);
1.166 + cylinder(h=pcb_hole_depth, r=pcb_hole_width / 2);
1.167 translate([pcb_right_hole_offset_from_centre -
1.168 - pcb_right_hole_width / 2, pcb_hole_start_depth,
1.169 + pcb_hole_width / 2, pcb_hole_start_depth,
1.170 pcb_right_hole_offset + pcb_right_hole_height])
1.171 rotate([-90, 0, 0])
1.172 - cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2);
1.173 + cylinder(h=pcb_hole_depth, r=pcb_hole_width / 2);
1.174 }
1.175
1.176 /* Holes for lugs. */
1.177 @@ -1118,6 +1133,7 @@
1.178 rotate([-90, 0, 0])
1.179 cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius);
1.180 }
1.181 + }
1.182 }
1.183
1.184 cartridge();