# HG changeset patch # User Paul Boddie # Date 1416868099 -3600 # Node ID 127c1ea316e15a8d2460356688c118530956cabe # Parent 8334ce389108c2bc0137862d4d227773636749bd Separated the payload and connector widths so that the former can be changed independently of the latter, although the payload currently remains centred on the connector whereas it should be justified with the right edge of the connector (and have a width limited only by the Plus 1 cartridge space/slot). diff -r 8334ce389108 -r 127c1ea316e1 cartridge.scad --- a/cartridge.scad Fri Oct 10 16:24:44 2014 +0200 +++ b/cartridge.scad Mon Nov 24 23:28:19 2014 +0100 @@ -71,6 +71,8 @@ } } + /* A fillet justified using the axes. */ + module fillet_justified(r, h) { if (FILLET) difference() { @@ -79,6 +81,17 @@ } } + /* A justified fillet with the extra material below the y-axis. */ + + module fillet_partitioned(r, h) { + if (FILLET) + difference() { + translate([0, 0, -extra]) + cube([r + extra, r + extra, h + extra]); + cylinder(r = r, h = h); + } + } + module fillet_torus(radius, rounding) { if (FILLET) difference() { @@ -127,7 +140,8 @@ /* Internal dimensions. */ - int_width = 86.0; + int_payload_width = 86.0; /* internal width in the payload section */ + int_connector_width = 86.0; /* limited to the Plus 1 socket dimensions */ int_payload_depth = 12.5; /* maximum depth in the payload section */ int_connector_depth = 11.0; /* maximum depth in the connector section */ int_payload_height = 50.8; /* space between the top and the floor */ @@ -158,7 +172,8 @@ /* Cartridge dimensions. */ - width = int_width + side + side; + payload_width = int_payload_width + side + side; + connector_width = int_connector_width + side + side; payload_height = top + int_payload_height; connector_height = bottom + int_connector_height; height = payload_height + bottom + int_connector_height; @@ -177,7 +192,7 @@ /* Label details. */ - front_label_width = 83.0; + front_label_width = payload_width - side - side - 3.0; front_label_height = 46.0; front_label_depth = 1.0; front_label_offset_from_bottom = 19.5; @@ -207,13 +222,17 @@ Offsets are measured from the outside surfaces. */ - inner_top_front_cutout_width = int_width; + inner_top_front_cutout_width = int_payload_width; inner_top_front_cutout_depth = top_groove_width; inner_top_front_cutout_height = top - top_groove_depth; - inner_side_front_cutout_height = height - top_groove_depth; - inner_side_front_cutout_width = front_side - groove_depth; - inner_side_front_cutout_depth = groove_width_overlap; + inner_payload_front_cutout_height = payload_height - top_groove_depth; + inner_payload_front_cutout_width = front_side - groove_depth; + inner_payload_front_cutout_depth = groove_width_overlap; + + inner_connector_front_cutout_height = connector_height; + inner_connector_front_cutout_width = front_side - groove_depth; + inner_connector_front_cutout_depth = groove_width_overlap; /* The back cavity is the indented part at the bottom of the back of the @@ -249,7 +268,7 @@ /* The tapering off of the inner front edge. */ - inner_front_edge_width = width - front_side * 2; + inner_front_edge_width = connector_width - front_side * 2; inner_front_edge_height = 3.0; inner_front_edge_depth = 1.5; @@ -267,7 +286,7 @@ */ edge_connector_cutout_front_depth = front_back_overlap; - edge_connector_cutout_front_width = (int_width - edge_connector_cutout_back_width) / 2; + edge_connector_cutout_front_width = (int_connector_width - edge_connector_cutout_back_width) / 2; /* Edge connectors are themselves 0.05" or approximately 1.27mm in @@ -375,7 +394,7 @@ module pcb_lug(xdir) { translate([xdir * - (int_width / 2 - pcb_lug_offset_from_inside), + (int_connector_width / 2 - pcb_lug_offset_from_inside), back_depth, int_payload_lower_extent + pcb_lug_offset_from_bottom ]) @@ -400,7 +419,7 @@ module pcb_front_lug(xdir) { translate([xdir * - (int_width / 2 - pcb_lug_offset_from_inside), + (int_connector_width / 2 - pcb_lug_offset_from_inside), -int_front_depth + pcb_front_lug_depth, int_payload_lower_extent + pcb_lug_offset_from_bottom ]) @@ -415,7 +434,7 @@ /* The actual shapes. */ - front_displacement = APART ? -width * 0.6 : 0; + front_displacement = APART ? -payload_width * 0.6 : 0; if (FRONT) translate([front_displacement, 0, 0]) @@ -428,16 +447,38 @@ /* Front portion. */ if (FRONT_SURFACE) { - cube_at(width, front, height, - 0, -1, 0, - 0, -int_front_depth, 0); - cube_at(front_left, front_depth, height, - -1, -1, 0, - -int_width / 2, 0, 0); - cube_at(front_right, front_depth, height, - 1, -1, 0, - int_width / 2, 0, 0); - cube_at(width, front_depth, top, + + /* Surfaces surrounding the payload. */ + + cube_at(payload_width, front, payload_height, + 0, -1, 1, + 0, -int_front_depth, int_payload_lower_extent); + + cube_at(front_left, front_depth, payload_height, + -1, -1, 1, + -int_payload_width / 2, 0, int_payload_lower_extent); + + cube_at(front_right, front_depth, payload_height, + 1, -1, 1, + int_payload_width / 2, 0, int_payload_lower_extent); + + /* Surfaces surrounding the connector. */ + + cube_at(connector_width, front, connector_height, + 0, -1, -1, + 0, -int_front_depth, int_payload_lower_extent); + + cube_at(front_left, front_depth, connector_height, + -1, -1, -1, + -int_connector_width / 2, 0, int_payload_lower_extent); + + cube_at(front_right, front_depth, connector_height, + 1, -1, -1, + int_connector_width / 2, 0, int_payload_lower_extent); + + /* Top surface for the front piece. */ + + cube_at(payload_width, front_depth, top, 0, -1, 1, 0, 0, int_payload_upper_extent); } @@ -446,7 +487,7 @@ /* Floor of cartridge. */ - cube_at(int_width, int_front_depth, bottom, + cube_at(int_connector_width, int_front_depth, bottom, 0, -1, 1, 0, 0, -height / 2 + int_connector_height); @@ -456,7 +497,7 @@ edge_connector_cutout_front_depth, bottom, 1, -1, 1, - -int_width / 2, + -int_connector_width / 2, 0, -height / 2 + int_connector_height); @@ -466,7 +507,7 @@ edge_connector_cutout_front_depth, bottom, -1, -1, 1, - int_width / 2, + int_connector_width / 2, 0, -height / 2 + int_connector_height); } @@ -537,17 +578,29 @@ 0, -1, 1, 0, 0, int_payload_upper_extent); - cube_at(inner_side_front_cutout_width, - inner_side_front_cutout_depth, - inner_side_front_cutout_height, - 1, -1, 0, - int_width / 2, 0, -inner_top_front_cutout_height); + cube_at(inner_payload_front_cutout_width, + inner_payload_front_cutout_depth, + inner_payload_front_cutout_height, + 1, -1, 1, + int_payload_width / 2, 0, int_payload_lower_extent); + + cube_at(inner_payload_front_cutout_width, + inner_payload_front_cutout_depth, + inner_payload_front_cutout_height, + -1, -1, 1, + -int_payload_width / 2, 0, int_payload_lower_extent); - cube_at(inner_side_front_cutout_width, - inner_side_front_cutout_depth, - inner_side_front_cutout_height, - -1, -1, 0, - -int_width / 2, 0, -inner_top_front_cutout_height); + cube_at(inner_connector_front_cutout_width, + inner_connector_front_cutout_depth, + inner_connector_front_cutout_height, + 1, -1, -1, + int_connector_width / 2, 0, int_payload_lower_extent); + + cube_at(inner_connector_front_cutout_width, + inner_connector_front_cutout_depth, + inner_connector_front_cutout_height, + -1, -1, -1, + -int_connector_width / 2, 0, int_payload_lower_extent); /* Fillets to round off the edges. */ @@ -555,11 +608,11 @@ /* Top left and right rounding. */ - translate([-width / 2 + ro, -front_depth / 2, height / 2 - ro]) + translate([-payload_width / 2 + ro, -front_depth / 2, height / 2 - ro]) rotate([0, 0, 180]) rotate([90, 0, 0]) fillet(rr, front_depth); - translate([width / 2 - ro, -front_depth / 2, height / 2 - ro]) + translate([payload_width / 2 - ro, -front_depth / 2, height / 2 - ro]) rotate([90, 0, 0]) fillet(rr, front_depth); @@ -568,14 +621,14 @@ translate([0, -front_depth + ro, height / 2 - ro]) rotate([0, 0, 180]) rotate([0, -90, 0]) - fillet(rr, width); + fillet(rr, payload_width); /* Edge rounding. */ - translate([-width / 2 + ro, -front_depth + ro, 0]) + translate([-payload_width / 2 + ro, -front_depth + ro, 0]) rotate([0, 0, 180]) fillet(rr, height); - translate([width / 2 - ro, -front_depth + ro, 0]) + translate([payload_width / 2 - ro, -front_depth + ro, 0]) rotate([0, 0, 270]) fillet(rr, height); } @@ -586,7 +639,7 @@ the same way, if APART is defined. */ - back_displacement = APART ? width * 0.6 : 0; + back_displacement = APART ? payload_width * 0.6 : 0; back_rotation = APART ? 180 : 0; if (BACK) @@ -602,65 +655,112 @@ if (BACK_SURFACE) { + /* Surfaces surrounding the payload. */ + /* Payload section of back surface. */ - cube_at(width, payload_back, payload_height, + cube_at(payload_width, payload_back, payload_height, 0, 1, 1, 0, int_payload_back_depth, int_payload_lower_extent); + cube_at(back_left, back_depth, payload_height, + -1, 1, 1, + -int_payload_width / 2, 0, int_payload_lower_extent); + + cube_at(back_right, back_depth, payload_height, + 1, 1, 1, + int_payload_width / 2, 0, int_payload_lower_extent); + + /* Surfaces surrounding the connector. */ + /* Connector section of back surface overlapping the floor. */ - cube_at(width, connector_back, connector_height, - 0, 1, 1, - 0, int_connector_back_depth, -height / 2); - - /* Sides of back piece. */ + cube_at(connector_width, connector_back, connector_height, + 0, 1, -1, + 0, int_connector_back_depth, int_payload_lower_extent); - cube_at(back_left, back_depth, height, - -1, 1, 0, - -int_width / 2, 0, 0); + cube_at(back_left, back_depth, connector_height, + -1, 1, -1, + -int_connector_width / 2, 0, int_payload_lower_extent); - cube_at(back_right, back_depth, height, - 1, 1, 0, - int_width / 2, 0, 0); + cube_at(back_right, back_depth, connector_height, + 1, 1, -1, + int_connector_width / 2, 0, int_payload_lower_extent); /* Top of back piece. */ - cube_at(width, back_depth, top, + cube_at(payload_width, back_depth, top, 0, 1, 1, 0, 0, int_payload_upper_extent); - /* The extension of the back to connect with the front. */ + /* + The extension of the back to connect with the front. Here, the inside + edges are rounded. The outside edges are rounded later. + + An extra overlapping measure is employed so that the filleting is + continuous between the payload and connector portions. On the inside + edges, the connector filleting is extended upwards. + */ + + /* Left side of payload. */ difference() { - cube_at(back_left - groove_depth, groove_width_extra, inner_side_front_cutout_height, + cube_at(back_left - groove_depth, groove_width_extra, inner_payload_front_cutout_height, -1, 1, 1, - -int_width / 2, -groove_width_extra, -height / 2); - translate([-int_width / 2 - groove_ro, -groove_width_extra + groove_ro, - -height / 2]) + -int_payload_width / 2, -groove_width_extra, int_payload_lower_extent); + translate([-int_payload_width / 2 - groove_ro, -groove_width_extra + groove_ro, + int_payload_lower_extent]) rotate([0, 0, -90]) - fillet_justified(groove_rr, inner_side_front_cutout_height); + fillet_justified(groove_rr, inner_payload_front_cutout_height); } + /* Right side of payload. */ + difference() { - cube_at(back_right - groove_depth, groove_width_extra, inner_side_front_cutout_height, + cube_at(back_right - groove_depth, groove_width_extra, inner_payload_front_cutout_height, 1, 1, 1, - int_width / 2, -groove_width_extra, -height / 2); - translate([int_width / 2 + groove_ro, -groove_width_extra + groove_ro, + int_payload_width / 2, -groove_width_extra, int_payload_lower_extent); + translate([int_payload_width / 2 + groove_ro, -groove_width_extra + groove_ro, + int_payload_lower_extent]) + rotate([0, 0, 180]) + fillet_justified(groove_rr, inner_payload_front_cutout_height); + } + + /* Left side of connector. */ + + difference() { + cube_at(back_left - groove_depth, groove_width_extra, inner_connector_front_cutout_height, + -1, 1, -1, + -int_connector_width / 2, -groove_width_extra, int_payload_lower_extent); + translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro, + -height / 2]) + rotate([0, 0, -90]) + fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra); + } + + /* Right side of connector. */ + + difference() { + cube_at(back_right - groove_depth, groove_width_extra, inner_connector_front_cutout_height, + 1, 1, -1, + int_connector_width / 2, -groove_width_extra, int_payload_lower_extent); + translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro, -height / 2]) rotate([0, 0, 180]) - fillet_justified(groove_rr, inner_side_front_cutout_height); + fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra); } + /* Top side. */ + difference() { - cube_at(width - groove_depth * 2, groove_width_extra, top - top_groove_depth, + cube_at(payload_width - groove_depth * 2, groove_width_extra, top - top_groove_depth, 0, 1, 1, 0, -groove_width_extra, int_payload_upper_extent); translate([0, -groove_width_extra + groove_ro, int_payload_upper_extent + groove_ro]) rotate([0, 0, 180]) rotate([0, 90, 0]) - fillet(groove_rr, width - groove_depth * 2); + fillet(groove_rr, payload_width - groove_depth * 2); } } @@ -668,7 +768,7 @@ /* Floor of cartridge. */ - cube_at(int_width, int_connector_back_depth, bottom, + cube_at(int_connector_width, int_connector_back_depth, bottom, 0, 1, 1, 0, 0, -height / 2 + int_connector_height); @@ -716,21 +816,21 @@ cube_at(groove_depth, groove_width_normal, height, 1, 1, 0, - -width / 2, 0, 0); + -payload_width / 2, 0, 0); /* Right groove. */ cube_at(groove_depth, groove_width_normal, height, -1, 1, 0, - width / 2, 0, 0); + payload_width / 2, 0, 0); /* Top grooves. */ - cube_at(width, groove_width_normal, groove_depth, + cube_at(payload_width, groove_width_normal, groove_depth, 0, 1, -1, 0, 0, height / 2); - cube_at(width, top_groove_width, top_groove_depth, + cube_at(payload_width, top_groove_width, top_groove_depth, 0, 1, -1, 0, -groove_width_extra, height / 2); } @@ -744,7 +844,7 @@ translate([0, back_depth, -height / 2]) linear_extrude(height = back_cavity_height) - translate([-int_width / 2, 0, 0]) + translate([-int_connector_width / 2, 0, 0]) polygon([ [back_cavity_offset_from_inner_left, 0], [back_cavity_inner_offset_from_inner_left, @@ -774,7 +874,7 @@ translate([0, int_connector_back_depth, -height / 2]) linear_extrude(height = int_connector_height) - translate([-int_width / 2, 0, 0]) + translate([-int_connector_width / 2, 0, 0]) polygon([ [0, 0], [inner_back_slope_max_offset, 0], @@ -785,7 +885,7 @@ translate([0, int_connector_back_depth, -height / 2]) linear_extrude(height = int_connector_height) - translate([int_width / 2, 0, 0]) + translate([int_connector_width / 2, 0, 0]) polygon([ [0, 0], [-inner_back_slope_max_offset, 0], @@ -813,11 +913,11 @@ /* Top left and right rounding. */ - translate([-width / 2 + ro, back_depth / 2, height / 2 - ro]) + translate([-payload_width / 2 + ro, back_depth / 2, height / 2 - ro]) rotate([0, 0, 180]) rotate([90, 0, 0]) fillet(rr, back_depth); - translate([width / 2 - ro, back_depth / 2, height / 2 - ro]) + translate([payload_width / 2 - ro, back_depth / 2, height / 2 - ro]) rotate([90, 0, 0]) fillet(rr, back_depth); @@ -825,33 +925,63 @@ translate([0, back_depth - ro, height / 2 - ro]) rotate([0, -90, 0]) - fillet(rr, width); + fillet(rr, payload_width); - /* Edge rounding. */ + /* Outer edge rounding. */ - translate([width / 2 - ro, back_depth - ro, 0]) - fillet(rr, height); - translate([-width / 2 + ro, back_depth - ro, 0]) + translate([payload_width / 2 - ro, back_depth - ro, int_payload_lower_extent - extra]) + fillet_justified(rr, payload_height + extra); + + translate([-payload_width / 2 + ro, back_depth - ro, int_payload_lower_extent - extra]) + rotate([0, 0, 90]) + fillet_justified(rr, payload_height + extra); + + translate([connector_width / 2 - ro, back_depth - ro, -height / 2]) + fillet_partitioned(rr, connector_height); + + translate([-connector_width / 2 + ro, back_depth - ro, -height / 2]) rotate([0, 0, 90]) - fillet(rr, height); + fillet_partitioned(rr, connector_height); + + /* + Outer edge rounding of the back extension. This is done as a + separate removal operation rather than occurring when creating the + extension in order to ensure that the edges are actually rounded. + + An extra overlapping measure is employed so that the filleting is + continuous between the payload and connector portions. On the outside + edges, the payload filleting is extended downwards. + */ - /* Outer edge rounding of the back extension. */ + translate([-payload_width / 2 + groove_depth + groove_ro, -groove_width_extra + groove_ro, + int_payload_lower_extent - extra]) + rotate([0, 0, 180]) + fillet_justified(groove_rr, inner_payload_front_cutout_height + extra); - translate([-width / 2 + groove_depth + groove_ro, -groove_width_extra + groove_ro, + translate([payload_width / 2 - groove_depth - groove_ro, -groove_width_extra + groove_ro, + int_payload_lower_extent - extra]) + rotate([0, 0, -90]) + fillet_justified(groove_rr, inner_payload_front_cutout_height + extra); + + /* Sides of connector. */ + + translate([-connector_width / 2 + groove_depth + groove_ro, -groove_width_extra + groove_ro, -height / 2]) rotate([0, 0, 180]) - fillet_justified(groove_rr, inner_side_front_cutout_height); + fillet_partitioned(groove_rr, inner_connector_front_cutout_height); - translate([width / 2 - groove_depth - groove_ro, -groove_width_extra + groove_ro, + translate([connector_width / 2 - groove_depth - groove_ro, -groove_width_extra + groove_ro, -height / 2]) rotate([0, 0, -90]) - fillet_justified(groove_rr, inner_side_front_cutout_height); + fillet_partitioned(groove_rr, inner_connector_front_cutout_height); + + /* Top of payload. */ translate([0, -groove_width_extra + groove_ro, int_payload_upper_extent + inner_top_front_cutout_height - groove_ro]) rotate([0, 0, 180]) rotate([0, -90, 0]) - fillet(groove_rr, width - groove_depth * 2); + fillet(groove_rr, payload_width - groove_depth * 2); } } @@ -931,13 +1061,13 @@ /* Holes for lugs. */ translate([ - -int_width / 2 + pcb_lug_offset_from_inside, + -int_connector_width / 2 + pcb_lug_offset_from_inside, pcb_hole_start_depth, pcb_lug_offset_from_bottom]) rotate([-90, 0, 0]) cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius); translate([ - int_width / 2 - pcb_lug_offset_from_inside, + int_connector_width / 2 - pcb_lug_offset_from_inside, pcb_hole_start_depth, pcb_lug_offset_from_bottom]) rotate([-90, 0, 0]) cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius);