Skip to content
Snippets Groups Projects
outline.scad 807 B
Newer Older
fxk8y's avatar
fxk8y committed

fxk8y's avatar
fxk8y committed
pcb_diameter = 45;
fxk8y's avatar
fxk8y committed
edge_diameter = 3;

pcb_e_d = pcb_diameter - edge_diameter;
fxk8y's avatar
fxk8y committed

module hex() {
fxk8y's avatar
fxk8y committed
  hull () {
    for (rz=[0:60:360]) rotate([0, 0, rz]) translate([0, pcb_e_d/2, 0]) circle(d=edge_diameter, $fn=100);
fxk8y's avatar
fxk8y committed
  }
}


module usb_c() {
fxk8y's avatar
fxk8y committed
  p = 0.1;
fxk8y's avatar
fxk8y committed

  module tri() {
    polygon([[0, 0], [p, 0], [0, p]]);
  }

  w = 6.1;
  h = 0.9;

  translate([-w/2, -h, 0]) difference() {
    square([w, h]);
    tri();
fxk8y's avatar
fxk8y committed
    translate([w, 0, 0]) mirror([1, 0, 0]) tri();
fxk8y's avatar
fxk8y committed
}
fxk8y's avatar
fxk8y committed
hexagon_wh_ratio = 0.8660253;  // calculated with https://hexagoncalculator.apphb.com/
function hex_width(h) = h * hexagon_wh_ratio;
fxk8y's avatar
fxk8y committed
correction = -0.2;  // TODO: figure out why translation fails. checked: calculation is ok

fxk8y's avatar
fxk8y committed
translate([0, 0, 0]) hex();
fxk8y's avatar
fxk8y committed
translate([-hex_width(pcb_diameter)/2 + correction, 0, 0]) rotate([0, 0, -90]) usb_c();