List: discuss@lists.openscad.org
From: Rob Ward
Re: [OpenSCAD] printing a punch out to avoid needing support
Sun, Nov 8, 2015 9:32 PM
2; // wall thickness
> pcbThick = 2; // PCB thickness
> pcbLen = bY; // length of PCB in slot
> lcdX = 51;
> lcdY = 72;
> rch = 0.1;
>
> module slot()
> cube([wall + rch, pcbLen, pcbThick]);
>
> module Top() {
> translate([-1.5*bX, 0, 0]) {
> cube([bX + 4*wall, 3, bZ + 2*wall]);
> translate([2 * wall + rch, 3, wall + rch])
> cube([bX - 2*rch, 2, bZ - 2*rch]);
> }
> }
>
> module Box() {
> difference() {
> // exterior; X is thicker for PC board slot
> cube([bX + 4*wall, bY + wall, bZ + 2*wall]);
> // interior
> translate([2*wall, wall, wall])
> cube([bX, bY + rch, bZ]);
> // slots for PC board
> translate([wall, bY - pcbLen + wall + rch, 32])
> slot();
> translate([2*wall + bX - rch, bY - pcbLen + wall + rch, 32])
> slot();
> // hole for LCD - deprecated
> *translate([wall + 5, wall + 16, bZ + wall - rch])
> cube([lcdX, lcdY, wall + 2*rch]);
> // perforation for LCD
> xMargin = (bX + 4*wall - lcdX) / 2;
> difference() {
> translate([xMargin, wall + 27, bZ + wall + 2*rch])
> cube([lcdX, lcdY, wall - 2*rch]);
> translate([xMargin + 0.25, wall + 27 + 0.25, bZ + wall -
> 2*rch])
> cube([lcdX - 0.5, lcdY - 0.5, wall + 4*rch]);
> }
> // hole for hanging
> translate([(bX + 4*wall)/2, 0.85*(bY + 2*wall), -1])
> rotate([0, 0, 90])
> cylinder(h = 10, r = 3, $fn = 3);
> // hole for USB
> translate([14.5 + 2*wall, -1, 5 + wall])
> cube([12.5, 11.25, 11]);
> // hole for DC
> translate([45.5 + 2*wall, -1, 4.5 + wall])
> cube([9.5, 11.5, 11]);
> }
> }
>
> Box();
> Top();