diff --git a/readme.md b/readme.md index 80016ae..7e58ca8 100644 --- a/readme.md +++ b/readme.md @@ -2034,6 +2034,10 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o ### Properties | Function | Description | |:--- |:--- | +| ```ff_back(type)``` | Flat flex back section size | +| ```ff_latch(type)``` | Flat flex latch size | +| ```ff_mid(type)``` | Flat flex middle section size | +| ```ff_slot(type)``` | Flat flex slot size | | ```hdmi_depth(type)``` | Front to back depth | | ```hdmi_height(type)``` | Outside height above the PCB | | ```hdmi_height1(type)``` | Inside height at the sides | @@ -2071,7 +2075,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o | ```block(size, colour, makes_cutout, cutouts)``` | Draw a coloured cube to represent a random PCB component | | ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and colour | | ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component | -| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 | +| ```flat_flex(type, cutout = false)``` | Draw flat flexistrip connector as used on RPI0 | | ```flex(cutout = false)``` | Draw flexistrip connector | | ```hdmi(type, cutout = false)``` | Draw HDMI socket | | ```jack(cutout = false)``` | Draw 3.5mm jack | @@ -2162,6 +2166,10 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o ### Properties | Function | Description | |:--- |:--- | +| ```ff_back(type)``` | Flat flex back section size | +| ```ff_latch(type)``` | Flat flex latch size | +| ```ff_mid(type)``` | Flat flex middle section size | +| ```ff_slot(type)``` | Flat flex slot size | | ```hdmi_depth(type)``` | Front to back depth | | ```hdmi_height(type)``` | Outside height above the PCB | | ```hdmi_height1(type)``` | Inside height at the sides | @@ -2199,7 +2207,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o | ```block(size, colour, makes_cutout, cutouts)``` | Draw a coloured cube to represent a random PCB component | | ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and colour | | ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component | -| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 | +| ```flat_flex(type, cutout = false)``` | Draw flat flexistrip connector as used on RPI0 | | ```flex(cutout = false)``` | Draw flexistrip connector | | ```hdmi(type, cutout = false)``` | Draw HDMI socket | | ```jack(cutout = false)``` | Draw 3.5mm jack | diff --git a/tests/PCB.scad b/tests/PCB.scad index 9c66844..a957f5d 100644 --- a/tests/PCB.scad +++ b/tests/PCB.scad @@ -95,7 +95,8 @@ test_pcb = ["TestPCB", "Test PCB", [ 80, 22, 0, "ax_res", res1_2, 10, 10, inch(0.2)], [ 60, 3, 0, "flex"], - [ 50, 15, 0, "flat_flex"], + [ 50, 15, -90, "flat_flex"], + [ 40, 15, -90, "flat_flex", true], [ 60, 35, 0, "D_plug", DCONN9], [ 50, 50, 0, "molex_hdr", 2], diff --git a/tests/png/pcb.png b/tests/png/pcb.png index 12c24f9..8fd8157 100644 Binary files a/tests/png/pcb.png and b/tests/png/pcb.png differ diff --git a/tests/png/pcbs.png b/tests/png/pcbs.png index 064761d..c8cee89 100644 Binary files a/tests/png/pcbs.png and b/tests/png/pcbs.png differ diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index e41b14d..378eaf8 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -642,50 +642,47 @@ module flex(cutout = false) { //! Draw flexistrip connector } } -module flat_flex(cutout = false) { //! Draw flat flexistrip connector as used on RPI0 - l1 = 17; - w1 = 1.4; - h1 = 1.2; +small_ff = [[11.8, 0.9], [17, 1.4, 1.2], [12, 1.6, 1.2], [16, 1.1, 1.2]]; +large_ff = [[16, 1.25], [22, 1.5, 2.25],[16, 4.0, 2.5], [21, 0, 2.5]]; - l2 = 15.4; - w2 = 1.6; - h2 = 1.0; +function ff_slot(type) = type[0]; //! Flat flex slot size +function ff_latch(type) = type[1]; //! Flat flex latch size +function ff_mid(type) = type[2]; //! Flat flex middle section size +function ff_back(type) = type[3]; //! Flat flex back section size - l3 = 16; - w3 = 1.1; - h3 = 1.2; +module flat_flex(type, cutout = false) { //! Draw flat flexistrip connector as used on RPI0 + slot = ff_slot(type); + latch = ff_latch(type); + mid = ff_mid(type); + back = ff_back(type); - l4 = 12; - - slot_l = 11.8; - slot_h = 0.9; - - w = w1 + w2 + w3; + w = latch.y + mid.y + back.y; if(cutout) ; else { - color(grey(30)) { - translate([w / 2 - w1, 0, h1 / 2]) - rotate([90, 0, 90]) - linear_extrude(w1) + color(grey(30)) + translate([0, w / 2 - latch.y]) + rotate([90, 0, 180]) + linear_extrude(latch.y) difference() { - square([l1, h1], center = true); + translate([-latch.x / 2, 0]) + square([latch.x, latch.z]); - translate([0, -h1 / 2]) - square([slot_l, slot_h * 2], center = true); + square([slot.x, slot.y * 2], center = true); } - } - color(grey(90)) { - translate([-w / 2 + w3 / 2, 0, h3 / 2]) - cube([w3, l3, h3], center = true); + color("ivory") { + translate([-back.x / 2, -w / 2]) + if(back.y) + cube(back); - translate([-w / 2 + w3 + w2 / 2, 0, h2 / 2]) - cube([w2, l2, h2], center = true); - - translate([-w / 2 + w3 + w2 / 2, 0, h3 / 2]) - cube([w2, l4, h3], center = true); + translate([-mid.x / 2, -w / 2 + back.y]) + cube(mid); } + + color(grey(80)) + translate([-back.x / 2, -w / 2 + back.y]) + cube([back.x, mid.y, mid.z - eps]); } } @@ -897,7 +894,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts); if(show(comp, "mini_hdmi")) hdmi(hdmi_mini, cutouts); if(show(comp, "flex")) flex(cutouts); - if(show(comp, "flat_flex")) flat_flex(cutouts); + if(show(comp, "flat_flex")) flat_flex(param(4, false) ? large_ff : small_ff, cutouts); if(show(comp, "uSD")) uSD(comp[4], cutouts); if(show(comp, "trimpot10")) trimpot10(param(4, false), cutouts); if(show(comp, "molex_usb_Ax2")) molex_usb_Ax2(cutouts); diff --git a/vitamins/pcbs.scad b/vitamins/pcbs.scad index c8230fd..ae8fab1 100644 --- a/vitamins/pcbs.scad +++ b/vitamins/pcbs.scad @@ -224,7 +224,7 @@ RPI0 = ["RPI0", "Raspberry Pi Zero", 65, 30, 1.4, 3, 2.75, 6, "gre [54, 2, -90, "usb_uA"], [41.4, 2, -90, "usb_uA"], [7.25, 16.7, 180, "uSD", [12, 11.5, 1.4]], - [-1.3, 15, 0, "flat_flex"], + [-1.3, 15, -90, "flat_flex"], ], [": Micro SD card"], [32.5 - 9.5 * 2.54, 26.5 - 1.27, 20, 2]];