summaryrefslogtreecommitdiff
path: root/Patronenhuelle.scad
blob: 079cbf603d1c2e5ee306b64847ebbe7f83e2c92c (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
Patronendicke = 7.5;
Patronenlaenge = 40;
Wanddicke = 3;
Gewindelaenge = 10;
Gang = 2;
epsilon = 0.01;

auszen = 1;

difference() {
  union() {
    translate([0,0,-Wanddicke])
      cylinder(h = Patronenlaenge/2 - Gewindelaenge/2 + Wanddicke, r = Patronendicke/2 + Wanddicke, $fn = 100);
    translate([0,0,Patronenlaenge/2])
      cylinder(h = Gewindelaenge, r = Patronendicke/2 + Wanddicke/3, $fn = 100, center = true);
    translate([0,0,Patronenlaenge/2 - Gewindelaenge/2]) {
      intersection() {
        difference() {
          linear_extrude(Gewindelaenge, twist = -Gewindelaenge / Gang * 360, slices = Gewindelaenge/Gang * 50, $fn = 100, convexity = 10)
            translate([-Patronendicke,epsilon])
              square(2*Patronendicke);
          cylinder(h = Patronenlaenge, r = Patronendicke/2 + auszen*epsilon, $fn = 100);
        }
        cylinder(h = Gewindelaenge, r = Patronendicke/2 + Wanddicke*2/3 - (1-auszen) * epsilon, $fn=100);
      }
      difference() {
        cylinder(h = Gewindelaenge, r = Patronendicke/2 + Wanddicke*auszen, $fn = 100);
        cylinder(h = Gewindelaenge, r = Patronendicke/2 + Wanddicke*2/3 + epsilon, $fn = 100);
      }
    }
  }
  cylinder(h = Patronenlaenge + Wanddicke, r = Patronendicke/2, $fn = 100);
  translate([0,0,(Patronenlaenge-Gewindelaenge)/2])
    cylinder(h = Patronenlaenge + Wanddicke, r = Patronendicke/2 + auszen * (Wanddicke/3 + epsilon), $fn = 100);
}