# HG changeset patch # User Paul Boddie # Date 1412721827 -7200 # Node ID 73b9ec08020dc5e83bf764b46fbb914b77a4ec99 # Parent e11b3f5d3972a2c1963065d9c3a41dc75eb848d1 Rounded the extension of the back piece by making the "extra" part a separate object and applying rounding to it, combining it with the back and then rounding off the outer edges. Ideally, the entire overlapping part would be handled separately and not just the "extra" part. diff -r e11b3f5d3972 -r 73b9ec08020d cartridge.scad --- a/cartridge.scad Tue Oct 07 22:32:35 2014 +0200 +++ b/cartridge.scad Wed Oct 08 00:43:47 2014 +0200 @@ -50,6 +50,9 @@ ro = rr; extra = 0.1; + groove_rr = 0.5; + groove_ro = groove_rr; + module fillet(r, h) { translate([0, 0, -h/2]) difference() { @@ -58,6 +61,13 @@ } } + module fillet_justified(r, h) { + difference() { + cube([r + extra, r + extra, h + extra]); + cylinder(r = r, h = h); + } + } + /* Justify an object of the given dimensions, according to the given factors (where 1 indicates moving the object to the positive side of an @@ -153,7 +163,7 @@ */ groove_width_exposed = GROOVE ? 1.5 : 0; - groove_width = groove_width_exposed + groove_width_overlap; + groove_width_normal = groove_width_exposed + front_back_overlap; groove_depth = 1.0; /* how deep the groove goes into each side */ /* Additional cutting to mate the back and front. */ @@ -562,15 +572,51 @@ cube_at(width, back, height, 0, 1, 0, 0, int_back_depth, 0); - cube_at(back_left, back_depth + groove_width_extra, height, + + cube_at(back_left, back_depth, height, -1, 1, 0, - -int_width / 2, -groove_width_extra, 0); - cube_at(back_right, back_depth + groove_width_extra, height, + -int_width / 2, 0, 0); + + cube_at(back_right, back_depth, height, 1, 1, 0, - int_width / 2, -groove_width_extra, 0); - cube_at(width, back_depth + groove_width_extra, top, + int_width / 2, 0, 0); + + cube_at(width, back_depth, top, 0, 1, 1, - 0, -groove_width_extra, int_payload_upper_extent); + 0, 0, int_payload_upper_extent); + + /* The extension of the back to connect with the front. */ + + difference() { + cube_at(back_left - groove_depth, groove_width_extra, inner_side_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]) + rotate([0, 0, -90]) + fillet_justified(groove_rr, inner_side_front_cutout_height); + } + + difference() { + cube_at(back_right - groove_depth, groove_width_extra, inner_side_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]) + rotate([0, 0, 180]) + fillet_justified(groove_rr, inner_side_front_cutout_height); + } + + difference() { + cube_at(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); + } } difference() { @@ -623,21 +669,21 @@ /* Left groove. */ - cube_at(groove_depth, groove_width, height, + cube_at(groove_depth, groove_width_normal, height, 1, 1, 0, - -width / 2, -groove_width_extra, 0); + -width / 2, 0, 0); /* Right groove. */ - cube_at(groove_depth, groove_width, height, + cube_at(groove_depth, groove_width_normal, height, -1, 1, 0, - width / 2, -groove_width_extra, 0); + width / 2, 0, 0); /* Top grooves. */ - cube_at(width, groove_width, groove_depth, + cube_at(width, groove_width_normal, groove_depth, 0, 1, -1, - 0, -groove_width_extra, height / 2); + 0, 0, height / 2); cube_at(width, top_groove_width, top_groove_depth, 0, 1, -1, @@ -743,6 +789,24 @@ translate([-width / 2 + ro, back_depth - ro, 0]) rotate([0, 0, 90]) fillet(rr, height); + + /* Outer edge rounding of the back extension. */ + + translate([-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); + + translate([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); + + 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); } }