Skip to content
Snippets Groups Projects
TransportProtection_TODO:MERGE.scad 735 B

$fs = 0.5;
$fa = 1.0;



pcb_w   = 40.5;
pcb_h   = 67.5;
pcb_r   =    5;  // edge radius
pcb_off =  0.4;
pcb_t   =    5;  // thickness including LED and inductor

_str = 2;


module pcb(w=pcb_w, h=pcb_h, r=pcb_r, off=pcb_off) {

  _w = w + 2*off;
  _h = h + 2*off;
  _r = r +   off;

  hull() for (tx=[_r, _w-_r], ty=[_r, _h-_r]) translate([tx, ty, 0]) circle(r=r);
}

module pcb3D(w=pcb_w, h=pcb_h, r=pcb_r, off=pcb_off, _str=1.6) {
  linear_extrude(_str, convexity=4) pcb(w, h, r, off);
}

module pcbBox(w=pcb_w, h=pcb_h, r=pcb_r, off=pcb_off, h=pcb_t, _str=_str) {

  difference() {
    pcb3D(w=w, h=h, r=r, off=off, _str=h);
    translate([_str, _str, _str]) pcb3D(w=w-2*_str, h=h-2*_str, r=r, off=off, _str=h);
  }
}

pcbBox();