# HG changeset patch # User Paul Boddie # Date 1460299518 -7200 # Node ID f5108ce21563ca270d6fc48986a6529b4fdec7c6 # Parent d92ba32aaf47a01e45231297dbc5fb3134e71f45 Extended the payload floor to reach the back of the cartridge so that the back connecting section can be removed, leaving a complete floor. Made the back connecting section optional. diff -r d92ba32aaf47 -r f5108ce21563 cartridge.scad --- a/cartridge.scad Fri Apr 08 21:01:36 2016 +0200 +++ b/cartridge.scad Sun Apr 10 16:45:18 2016 +0200 @@ -24,16 +24,24 @@ ROM_CARTRIDGE = 0; WIDE_CARTRIDGE = 1; + /* Set this to the desired model type. */ + + MODEL = ROM_CARTRIDGE; + /* Configure the generated shapes. For the absolute simplest shape (for basic 3D printers)... - BACK_CAVITY = 1; FRONT_LABEL_INSET = 0; TOP_LABEL_INSET = 0; + BACK_CONNECTOR_SECTION = 0; + FRONT_LABEL_INSET = 0; TOP_LABEL_INSET = 0; GROOVE = 0; ROUND_EDGES = 0; ROUND_CONNECTING_EDGES = 0 Leave all options enabled for more capable 3D printers. */ + /* The back part of the connecting section of the cartridge. */ + BACK_CONNECTOR_SECTION = 1; + /* A necessary exterior cavity to let the cartridge fit inside the slot. */ BACK_CAVITY = 1; @@ -50,10 +58,6 @@ /* Recommended rounding of connection edges. */ ROUND_CONNECTING_EDGES = 1; - /* Set this to the desired model type. */ - - MODEL = ROM_CARTRIDGE; - /* Set this where a shorter PCB is to be used. */ SHORT_PCB = 0; @@ -757,17 +761,22 @@ -1, -1, 1, int_payload_left_extent, 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); + if (BACK_CONNECTOR_SECTION) { + + /* Cutout to accept the back connector sides. */ - 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); + + 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. */ @@ -853,17 +862,19 @@ /* Connector section of back surface overlapping the floor. */ - cube_at(connector_width, connector_back, connector_height, - 0, 1, -1, - 0, int_connector_back_depth, int_payload_lower_extent); + if (BACK_CONNECTOR_SECTION) { + 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, connector_height, - -1, 1, -1, - -int_connector_width / 2, 0, int_payload_lower_extent); + 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, connector_height, - 1, 1, -1, - int_connector_width / 2, 0, int_payload_lower_extent); + cube_at(back_right, back_depth, connector_height, + 1, 1, -1, + int_connector_width / 2, 0, int_payload_lower_extent); + } /* Top of back piece. */ @@ -907,30 +918,35 @@ fillet_justified(groove_rr, inner_payload_front_cutout_height); } - /* Left side of connector. */ + if (BACK_CONNECTOR_SECTION) { + + /* 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); - if (ROUND_CONNECTING_EDGES) - translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro, - lower_extent]) - rotate([0, 0, -90]) - fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra); - } + 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); + if (ROUND_CONNECTING_EDGES) + translate([-int_connector_width / 2 - groove_ro, -groove_width_extra + groove_ro, + lower_extent]) + rotate([0, 0, -90]) + fillet_partitioned(groove_rr, + inner_connector_front_cutout_height + extra); + } - /* Right side of connector. */ + /* 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); - if (ROUND_CONNECTING_EDGES) - translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro, - lower_extent]) - rotate([0, 0, 180]) - fillet_partitioned(groove_rr, inner_connector_front_cutout_height + extra); + 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); + if (ROUND_CONNECTING_EDGES) + translate([int_connector_width / 2 + groove_ro, -groove_width_extra + groove_ro, + lower_extent]) + rotate([0, 0, 180]) + fillet_partitioned(groove_rr, + inner_connector_front_cutout_height + extra); + } } /* Top side. */ @@ -952,7 +968,7 @@ /* Floor of cartridge. */ - cube_at(int_connector_width, int_connector_back_depth, bottom, + cube_at(connector_width, back_depth, bottom, 0, 1, 1, 0, 0, lower_extent + int_connector_height); @@ -1043,77 +1059,80 @@ payload_centre, -groove_width_extra, upper_extent); } - /* Back cavity. */ + if (BACK_CONNECTOR_SECTION) { + + /* Back cavity. */ - if (BACK_CAVITY) - intersection() { + if (BACK_CAVITY) + intersection() { - /* From the bottom upwards. */ + /* From the bottom upwards. */ - translate([0, back_depth, lower_extent]) - linear_extrude(height = back_cavity_height) - translate([-int_connector_width / 2, 0, 0]) - polygon([ - [back_cavity_offset_from_inner_left, 0], - [back_cavity_inner_offset_from_inner_left, - -back_cavity_depth], - [back_cavity_inner_offset_from_inner_left + - back_cavity_inner_width, - -back_cavity_depth], - [back_cavity_offset_from_inner_left + - back_cavity_width, 0] - ]); + translate([0, back_depth, lower_extent]) + linear_extrude(height = back_cavity_height) + translate([-int_connector_width / 2, 0, 0]) + polygon([ + [back_cavity_offset_from_inner_left, 0], + [back_cavity_inner_offset_from_inner_left, + -back_cavity_depth], + [back_cavity_inner_offset_from_inner_left + + back_cavity_inner_width, + -back_cavity_depth], + [back_cavity_offset_from_inner_left + + back_cavity_width, 0] + ]); - /* From left to right. */ + /* From left to right. */ - translate([back_cavity_width / 2, back_depth, lower_extent]) - rotate([0, -90, 0]) - linear_extrude(height = back_cavity_width) - polygon([ - [-extra, -back_cavity_depth], - [back_cavity_inner_height, - -back_cavity_depth], - [back_cavity_height, 0], - [-extra, 0] - ]); - } + translate([back_cavity_width / 2, back_depth, lower_extent]) + rotate([0, -90, 0]) + linear_extrude(height = back_cavity_width) + polygon([ + [-extra, -back_cavity_depth], + [back_cavity_inner_height, + -back_cavity_depth], + [back_cavity_height, 0], + [-extra, 0] + ]); + } - /* Inner back cavities. */ + /* Inner back cavities. */ - translate([0, int_connector_back_depth, lower_extent]) - linear_extrude(height = int_connector_height) - translate([-int_connector_width / 2, 0, 0]) - polygon([ - [0, 0], - [inner_back_slope_max_offset, 0], - [inner_back_slope_min_offset, - inner_back_slope_depth], - [0, inner_back_slope_depth] - ]); + translate([0, int_connector_back_depth, lower_extent]) + linear_extrude(height = int_connector_height) + translate([-int_connector_width / 2, 0, 0]) + polygon([ + [0, 0], + [inner_back_slope_max_offset, 0], + [inner_back_slope_min_offset, + inner_back_slope_depth], + [0, inner_back_slope_depth] + ]); - translate([0, int_connector_back_depth, lower_extent]) - linear_extrude(height = int_connector_height) - translate([int_connector_width / 2, 0, 0]) - polygon([ - [0, 0], - [-inner_back_slope_max_offset, 0], - [-inner_back_slope_min_offset, - inner_back_slope_depth], - [0, inner_back_slope_depth] - ]); + translate([0, int_connector_back_depth, lower_extent]) + linear_extrude(height = int_connector_height) + translate([int_connector_width / 2, 0, 0]) + polygon([ + [0, 0], + [-inner_back_slope_max_offset, 0], + [-inner_back_slope_min_offset, + inner_back_slope_depth], + [0, inner_back_slope_depth] + ]); - /* Inner back edge cavity. */ + /* Inner back edge cavity. */ - translate([inner_back_edge_width / 2, - int_connector_back_depth + inner_back_edge_depth, lower_extent]) - rotate([0, -90, 0]) - linear_extrude(height = inner_back_edge_width) - polygon([ - [-extra, -inner_back_edge_depth], - [inner_back_edge_height, -inner_back_edge_depth], - [0, 0], - [-extra, 0] - ]); + translate([inner_back_edge_width / 2, + int_connector_back_depth + inner_back_edge_depth, lower_extent]) + rotate([0, -90, 0]) + linear_extrude(height = inner_back_edge_width) + polygon([ + [-extra, -inner_back_edge_depth], + [inner_back_edge_height, -inner_back_edge_depth], + [0, 0], + [-extra, 0] + ]); + } /* Fillets to round off the edges. */ @@ -1145,12 +1164,14 @@ rotate([0, 0, 90]) fillet_justified(rr, payload_height + bottom + extra); - translate([connector_width / 2 - ro, back_depth - ro, lower_extent]) - fillet_partitioned(rr, connector_height - bottom); + if (BACK_CONNECTOR_SECTION) { + translate([connector_width / 2 - ro, back_depth - ro, lower_extent]) + fillet_partitioned(rr, connector_height - bottom); - translate([-connector_width / 2 + ro, back_depth - ro, lower_extent]) - rotate([0, 0, 90]) - fillet_partitioned(rr, connector_height - bottom); + translate([-connector_width / 2 + ro, back_depth - ro, lower_extent]) + rotate([0, 0, 90]) + fillet_partitioned(rr, connector_height - bottom); + } } if (ROUND_CONNECTING_EDGES) {