summaryrefslogtreecommitdiff
path: root/Schluesselanhaenger.scad
blob: 6cf5d34acc65a6605a9c358e643ec03a24a27934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
d = 2;
h = 10;
b = 30;
alpha = 30;
r = 2.5;
rBohrung = 1;
gravurTiefe = 0.5;

difference() {
  union() {
    rotate_extrude(angle = 180, $fn = 100)
      translate([h/2,0,0])
        circle(r = d/2, $fn = 100);
    for (i=[-1:2:1]) {
      translate([i*h/2,0,0])
        rotate([90,0,0])
          linear_extrude(b)
            circle(r = d/2, $fn = 100);
      rotate([0,90*(i+1),0]) {
        translate([0,-b,0])
          rotate_extrude(angle = -alpha, $fn = 100)
            translate([h/2,0,0])
              circle(r = d/2, $fn = 100);
        translate([-h/2*cos(alpha),-b-h/2*sin(alpha),0])
          rotate([90,0,alpha])
            linear_extrude((h/2-r)/tan(alpha))
              circle(r = d/2, $fn = 100);
      }
    }
    translate([0,-b-h/2*sin(alpha)+r*sin(180-alpha)-(h/2-r)/tan(alpha)*cos(alpha),0]) {
      rotate([0,0,-180+alpha])
        rotate_extrude(angle = 180 - 2*alpha, $fn = 100)
          translate([r,0,0])
            circle(r = d/2, $fn = 100);
      rotate_extrude(angle = 360, $fn = 100)
        translate([rBohrung + d/2,0,0])
          circle(r = d/2, $fn = 100);
    }
    translate([0,0,-d/2])
      linear_extrude(d)
        difference() {
          union() {
            translate([-h/2,-b])
              square([h,b]);
            for (i=[0:1])
              translate([0,-b*i,0])
                circle(r = h/2, $fn = 100);
            translate([0,-b-h/2*sin(alpha)+r*sin(180-alpha)-(h/2-r)/tan(alpha)*cos(alpha)])
              circle(r = r, $fn = 100);
            polygon([
              [-h/2*cos(alpha),-b-h/2*sin(alpha)],
              [-r*cos(alpha),-b-h/2*sin(alpha)-(h/2-r)/tan(alpha)*cos(alpha)],
              [r*cos(alpha),-b-h/2*sin(alpha)-(h/2-r)/tan(alpha)*cos(alpha)],
              [h/2*cos(alpha),-b-h/2*sin(alpha)],
            ]);
          }
        translate([0,-b-h/2*sin(alpha)+r*sin(180-alpha)-(h/2-r)/tan(alpha)*cos(alpha)])
          circle(r = rBohrung + d/2, $fn = 100);
      }
  }
  translate([0,-b/2,d/2-gravurTiefe])
    rotate([0,0,90])
      linear_extrude(2*gravurTiefe)
        text("links", size = 0.8*h, halign = "center", valign = "center");
  translate([0,-b/2,-d/2+gravurTiefe])
    rotate([0,180,-90])
      linear_extrude(2*gravurTiefe)
        text("rechts", size = 0.8*h, halign = "center", valign = "center");
}