# HG changeset patch # User Paul Boddie # Date 1412713955 -7200 # Node ID e11b3f5d3972a2c1963065d9c3a41dc75eb848d1 # Parent a2795ba78bdbfa5b672a1059bda4a064e392e2f0 Added a PCB model for checking. Tidied the floor widths and made the lug offsets relative to the internal width. diff -r a2795ba78bdb -r e11b3f5d3972 cartridge.scad --- a/cartridge.scad Tue Oct 07 19:42:36 2014 +0200 +++ b/cartridge.scad Tue Oct 07 22:32:35 2014 +0200 @@ -26,9 +26,20 @@ TOP_LABEL_INSET = 1; GROOVE = 1; + /* + Options for checking. Some useful combinations... + + Check feature alignment: APART = 0; BACK_SURFACE = 0; FRONT_SURFACE = 0; + Check PCB alignment: PCB = 1; BACK_SURFACE = 0; + */ + BACK = 1; BACK_SURFACE = 1; FRONT = 1; FRONT_SURFACE = 1; + + /* For printing: APART = 1; PCB = 0; */ + APART = 1; + PCB = 0; /* Rounding/fillet radius and additional margin of subtracted @@ -112,6 +123,7 @@ height = top + int_payload_height + bottom + int_connector_height; depth = int_depth + front + back; int_payload_upper_extent = height / 2 - top; + int_payload_lower_extent = -height / 2 + int_connector_height + bottom; /* Cartridge surfaces. */ @@ -235,7 +247,7 @@ pcb_front_support_height = pcb_back_support_height; /* - Features measured from the Stardot Dual ROM Adaptor cartridge board + Features measured from the Stardot Dual ROM Adaptor cartridge board dimensions diagram. Offsets are from inside the bottom "floor". */ @@ -257,7 +269,7 @@ pcb_lug_inner_radius = 1.0; pcb_lug_outer_radius = 5.5 / 2; pcb_lug_offset_from_bottom = 14.35; - pcb_lug_offset_from_outside = 7.55; + pcb_lug_offset_from_inside = 5.55; pcb_lug_cross_width = 6.7; pcb_lug_cross_depth = pcb_back_support_depth; @@ -285,7 +297,7 @@ translate([xdir * pcb_support_offset_from_centre, edge_connector_cutout_back_depth, - -height / 2 + bottom + int_connector_height]) + int_payload_lower_extent]) justify(pcb_back_support_width, pcb_back_support_depth, pcb_back_support_height, @@ -323,10 +335,9 @@ module pcb_lug(xdir) { translate([xdir * - (width/2 - pcb_lug_offset_from_outside), + (int_width / 2 - pcb_lug_offset_from_inside), back_depth, - -height / 2 + bottom + int_connector_height + - pcb_lug_offset_from_bottom + int_payload_lower_extent + pcb_lug_offset_from_bottom ]) rotate([90, 0, 0]) difference() { @@ -347,10 +358,9 @@ module pcb_front_lug(xdir) { translate([xdir * - (width/2 - pcb_lug_offset_from_outside), + (int_width / 2 - pcb_lug_offset_from_inside), -int_front_depth + pcb_front_lug_depth, - -height / 2 + bottom + int_connector_height + - pcb_lug_offset_from_bottom + int_payload_lower_extent + pcb_lug_offset_from_bottom ]) rotate([90, 0, 0]) difference() { @@ -394,7 +404,7 @@ /* Floor of cartridge. */ - cube_at(width, int_front_depth, bottom, + cube_at(int_width, int_front_depth, bottom, 0, -1, 1, 0, 0, -height / 2 + int_connector_height); @@ -427,7 +437,7 @@ -1, -1, 1, -pcb_support_offset_from_centre, 0, - -height / 2 + bottom + int_connector_height); + int_payload_lower_extent); cube_at(pcb_front_support_width, pcb_front_support_depth, @@ -435,7 +445,7 @@ 1, -1, 1, pcb_support_offset_from_centre, 0, - -height / 2 + bottom + int_connector_height); + int_payload_lower_extent); /* Circular "lugs" to hold PCBs in place. */ @@ -567,7 +577,7 @@ /* Floor of cartridge. */ - cube_at(width, int_back_depth, bottom, + cube_at(int_width, int_back_depth, bottom, 0, 1, 1, 0, 0, -height / 2 + int_connector_height); @@ -735,6 +745,94 @@ fillet(rr, height); } } + + /* PCB for checking. */ + + pcb_width = 84.85; pcb_height = 62.5; pcb_depth = 1; + edge_connector_width = 56.5; edge_connector_height = 11.85; + pcb_position_y = int_payload_lower_extent; + + pcb_left_hole_offset = pcb_back_support_left_bump_offset_from_bottom + + 0.55; + pcb_left_hole_width = 2.2; + pcb_left_hole_height = pcb_back_support_left_bump_height - 0.55 * 2; + pcb_left_hole_offset_from_centre = pcb_support_offset_from_centre + + pcb_back_support_width / 2 - pcb_left_hole_width / 2; + + pcb_right_hole_offset = pcb_back_support_right_bump_offset_from_bottom + + 0.55; + pcb_right_hole_width = pcb_left_hole_width; + pcb_right_hole_height = pcb_back_support_right_bump_height - 0.55 * 2; + pcb_right_hole_offset_from_centre = -pcb_left_hole_offset_from_centre; + + pcb_hole_depth = pcb_depth + 0.2; + pcb_hole_start_depth = -0.1; + pcb_lug_hole_radius = 3.75; + + if (PCB) + translate([back_displacement, 0, 0]) + translate([0, 0, pcb_position_y]) + difference() { + + /* Mock PCB. */ + + union() { + cube_at(pcb_width, pcb_depth, + pcb_height - edge_connector_height, + 0, 1, 1, + 0, 0, 0); + cube_at(edge_connector_width, pcb_depth, + edge_connector_height, + 0, 1, -1, + 0, 0, 0); + } + + /* Holes for mounting. */ + + union() { + cube_at(pcb_left_hole_width, 1, pcb_left_hole_height, + 1, 1, 1, + pcb_left_hole_offset_from_centre, 0, pcb_left_hole_offset); + translate([pcb_left_hole_offset_from_centre + + pcb_left_hole_width / 2, pcb_hole_start_depth, pcb_left_hole_offset]) + rotate([-90, 0, 0]) + cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2); + translate([pcb_left_hole_offset_from_centre + + pcb_left_hole_width / 2, pcb_hole_start_depth, + pcb_left_hole_offset + pcb_left_hole_height]) + rotate([-90, 0, 0]) + cylinder(h=pcb_hole_depth, r=pcb_left_hole_width / 2); + } + + union() { + cube_at(pcb_right_hole_width, 1, pcb_right_hole_height, + -1, 1, 1, + pcb_right_hole_offset_from_centre, 0, pcb_right_hole_offset); + translate([pcb_right_hole_offset_from_centre - + pcb_right_hole_width / 2, pcb_hole_start_depth, pcb_right_hole_offset]) + rotate([-90, 0, 0]) + cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2); + translate([pcb_right_hole_offset_from_centre - + pcb_right_hole_width / 2, pcb_hole_start_depth, + pcb_right_hole_offset + pcb_right_hole_height]) + rotate([-90, 0, 0]) + cylinder(h=pcb_hole_depth, r=pcb_right_hole_width / 2); + } + + /* Holes for lugs. */ + + translate([ + -int_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, + pcb_hole_start_depth, pcb_lug_offset_from_bottom]) + rotate([-90, 0, 0]) + cylinder(h=pcb_hole_depth, r=pcb_lug_hole_radius); + } } cartridge();