// Innengewinde
r4  = 27.0/2;
r3m =  4.0*0.8/2;
// gewindetiefe
gt = 12.0;
// winkel bohrer
wb = 118/2;
// winkeloffset um von den 4 streben wegzukommen
wo1 =10/360*2*Pi;

Point(1110) = {r4*Sin(wo1), r4*Cos(wo1) , fhr};
Point(1111) = {r4*Sin(wo1), r4*Cos(wo1) + r3m , fhr};
Point(1112) = {r4*Sin(wo1) + r3m, r4*Cos(wo1), fhr};
Point(1113) = {r4*Sin(wo1), r4*Cos(wo1) - r3m , fhr};
Point(1114) = {r4*Sin(wo1) - r3m, r4*Cos(wo1), fhr};
Point(1120) = {r4*Sin(wo1), r4*Cos(wo1) , fhr - gt};
Point(1121) = {r4*Sin(wo1), r4*Cos(wo1) + r3m,  fhr - gt - r3m/Tan(wb)};
Point(1122) = {r4*Sin(wo1) + r3m, r4*Cos(wo1),  fhr - gt - r3m/Tan(wb)};
Point(1123) = {r4*Sin(wo1), r4*Cos(wo1) - r3m , fhr - gt - r3m/Tan(wb)};
Point(1124) = {r4*Sin(wo1) - r3m, r4*Cos(wo1),  fhr - gt - r3m/Tan(wb)};
Point(1125) = {r4*Sin(wo1), r4*Cos(wo1) , fhr - gt - r3m/Tan(wb)};
Circle(1120) = {1111, 1110, 1112};
Circle(1121) = {1112, 1110, 1113};
Circle(1122) = {1113, 1110, 1114};
Circle(1123) = {1114, 1110, 1111};
Circle(1220) = {1121, 1125, 1122};
Circle(1221) = {1122, 1125, 1123};
Circle(1222) = {1123, 1125, 1124};
Circle(1223) = {1124, 1125, 1121};
Line(1310) = {1121, 1120};
Line(1311) = {1122, 1120};
Line(1312) = {1123, 1120};
Line(1313) = {1124, 1120};
Line(1314) = {1121, 1111};
Line(1315) = {1122, 1112};
Line(1316) = {1123, 1113};
Line(1317) = {1124, 1114};

// 2. Gewinde
wo2 = wo1 + 60/360*2*Pi;
Point(3110) = {r4*Sin(wo2), r4*Cos(wo2) , fhr};
Point(3111) = {r4*Sin(wo2), r4*Cos(wo2) + r3m , fhr};
Point(3112) = {r4*Sin(wo2) + r3m, r4*Cos(wo2), fhr};
Point(3113) = {r4*Sin(wo2), r4*Cos(wo2) - r3m , fhr};
Point(3114) = {r4*Sin(wo2) - r3m, r4*Cos(wo2), fhr};
Point(3120) = {r4*Sin(wo2), r4*Cos(wo2) , fhr - gt};
Point(3121) = {r4*Sin(wo2), r4*Cos(wo2) + r3m,  fhr - gt - r3m/Tan(wb)};
Point(3122) = {r4*Sin(wo2) + r3m, r4*Cos(wo2),  fhr - gt - r3m/Tan(wb)};
Point(3123) = {r4*Sin(wo2), r4*Cos(wo2) - r3m , fhr - gt - r3m/Tan(wb)};
Point(3124) = {r4*Sin(wo2) - r3m, r4*Cos(wo2),  fhr - gt - r3m/Tan(wb)};
Point(3125) = {r4*Sin(wo2), r4*Cos(wo2) , fhr - gt - r3m/Tan(wb)};
Circle(3120) = {3111, 3110, 3112};
Circle(3121) = {3112, 3110, 3113};
Circle(3122) = {3113, 3110, 3114};
Circle(3123) = {3114, 3110, 3111};
Circle(3220) = {3121, 3125, 3122};
Circle(3221) = {3122, 3125, 3123};
Circle(3222) = {3123, 3125, 3124};
Circle(3223) = {3124, 3125, 3121};
Line(3310) = {3121, 3120};
Line(3311) = {3122, 3120};
Line(3312) = {3123, 3120};
Line(3313) = {3124, 3120};
Line(3314) = {3121, 3111};
Line(3315) = {3122, 3112};
Line(3316) = {3123, 3113};
Line(3317) = {3124, 3114};

// 3. Gewinde
wo3 = wo2 + 60/360*2*Pi;
Point(5110) = {r4*Sin(wo3), r4*Cos(wo3) , fhr};
Point(5111) = {r4*Sin(wo3), r4*Cos(wo3) + r3m , fhr};
Point(5112) = {r4*Sin(wo3) + r3m, r4*Cos(wo3), fhr};
Point(5113) = {r4*Sin(wo3), r4*Cos(wo3) - r3m , fhr};
Point(5114) = {r4*Sin(wo3) - r3m, r4*Cos(wo3), fhr};
Point(5120) = {r4*Sin(wo3), r4*Cos(wo3) , fhr - gt};
Point(5121) = {r4*Sin(wo3), r4*Cos(wo3) + r3m,  fhr - gt - r3m/Tan(wb)};
Point(5122) = {r4*Sin(wo3) + r3m, r4*Cos(wo3),  fhr - gt - r3m/Tan(wb)};
Point(5123) = {r4*Sin(wo3), r4*Cos(wo3) - r3m , fhr - gt - r3m/Tan(wb)};
Point(5124) = {r4*Sin(wo3) - r3m, r4*Cos(wo3),  fhr - gt - r3m/Tan(wb)};
Point(5125) = {r4*Sin(wo3), r4*Cos(wo3) , fhr - gt - r3m/Tan(wb)};
Circle(5120) = {5111, 5110, 5112};
Circle(5121) = {5112, 5110, 5113};
Circle(5122) = {5113, 5110, 5114};
Circle(5123) = {5114, 5110, 5111};
Circle(5220) = {5121, 5125, 5122};
Circle(5221) = {5122, 5125, 5123};
Circle(5222) = {5123, 5125, 5124};
Circle(5223) = {5124, 5125, 5121};
Line(5310) = {5121, 5120};
Line(5311) = {5122, 5120};
Line(5312) = {5123, 5120};
Line(5313) = {5124, 5120};
Line(5314) = {5121, 5111};
Line(5315) = {5122, 5112};
Line(5316) = {5123, 5113};
Line(5317) = {5124, 5114};

// 4. Gewinde
wo4 = wo3 + 60/360*2*Pi;
Point(7110) = {r4*Sin(wo4), r4*Cos(wo4) , fhr};
Point(7111) = {r4*Sin(wo4), r4*Cos(wo4) + r3m , fhr};
Point(7112) = {r4*Sin(wo4) + r3m, r4*Cos(wo4), fhr};
Point(7113) = {r4*Sin(wo4), r4*Cos(wo4) - r3m , fhr};
Point(7114) = {r4*Sin(wo4) - r3m, r4*Cos(wo4), fhr};
Point(7120) = {r4*Sin(wo4), r4*Cos(wo4) , fhr - gt};
Point(7121) = {r4*Sin(wo4), r4*Cos(wo4) + r3m,  fhr - gt - r3m/Tan(wb)};
Point(7122) = {r4*Sin(wo4) + r3m, r4*Cos(wo4),  fhr - gt - r3m/Tan(wb)};
Point(7123) = {r4*Sin(wo4), r4*Cos(wo4) - r3m , fhr - gt - r3m/Tan(wb)};
Point(7124) = {r4*Sin(wo4) - r3m, r4*Cos(wo4),  fhr - gt - r3m/Tan(wb)};
Point(7125) = {r4*Sin(wo4), r4*Cos(wo4) , fhr - gt - r3m/Tan(wb)};
Circle(7120) = {7111, 7110, 7112};
Circle(7121) = {7112, 7110, 7113};
Circle(7122) = {7113, 7110, 7114};
Circle(7123) = {7114, 7110, 7111};
Circle(7220) = {7121, 7125, 7122};
Circle(7221) = {7122, 7125, 7123};
Circle(7222) = {7123, 7125, 7124};
Circle(7223) = {7124, 7125, 7121};
Line(7310) = {7121, 7120};
Line(7311) = {7122, 7120};
Line(7312) = {7123, 7120};
Line(7313) = {7124, 7120};
Line(7314) = {7121, 7111};
Line(7315) = {7122, 7112};
Line(7316) = {7123, 7113};
Line(7317) = {7124, 7114};

// 5. Gewinde
wo5 = wo4 + 60/360*2*Pi;
Point(9110) = {r4*Sin(wo5), r4*Cos(wo5) , fhr};
Point(9111) = {r4*Sin(wo5), r4*Cos(wo5) + r3m , fhr};
Point(9112) = {r4*Sin(wo5) + r3m, r4*Cos(wo5), fhr};
Point(9113) = {r4*Sin(wo5), r4*Cos(wo5) - r3m , fhr};
Point(9114) = {r4*Sin(wo5) - r3m, r4*Cos(wo5), fhr};
Point(9120) = {r4*Sin(wo5), r4*Cos(wo5) , fhr - gt};
Point(9121) = {r4*Sin(wo5), r4*Cos(wo5) + r3m,  fhr - gt - r3m/Tan(wb)};
Point(9122) = {r4*Sin(wo5) + r3m, r4*Cos(wo5),  fhr - gt - r3m/Tan(wb)};
Point(9123) = {r4*Sin(wo5), r4*Cos(wo5) - r3m , fhr - gt - r3m/Tan(wb)};
Point(9124) = {r4*Sin(wo5) - r3m, r4*Cos(wo5),  fhr - gt - r3m/Tan(wb)};
Point(9125) = {r4*Sin(wo5), r4*Cos(wo5) , fhr - gt - r3m/Tan(wb)};
Circle(9120) = {9111, 9110, 9112};
Circle(9121) = {9112, 9110, 9113};
Circle(9122) = {9113, 9110, 9114};
Circle(9123) = {9114, 9110, 9111};
Circle(9220) = {9121, 9125, 9122};
Circle(9221) = {9122, 9125, 9123};
Circle(9222) = {9123, 9125, 9124};
Circle(9223) = {9124, 9125, 9121};
Line(9310) = {9121, 9120};
Line(9311) = {9122, 9120};
Line(9312) = {9123, 9120};
Line(9313) = {9124, 9120};
Line(9314) = {9121, 9111};
Line(9315) = {9122, 9112};
Line(9316) = {9123, 9113};
Line(9317) = {9124, 9114};

// 5. Gewinde
wo6 = wo5 + 60/360*2*Pi;
 Point(11110) = {r4*Sin(wo6), r4*Cos(wo6) , fhr};
 Point(11111) = {r4*Sin(wo6), r4*Cos(wo6) + r3m , fhr};
 Point(11112) = {r4*Sin(wo6) + r3m, r4*Cos(wo6), fhr};
 Point(11113) = {r4*Sin(wo6), r4*Cos(wo6) - r3m , fhr};
 Point(11114) = {r4*Sin(wo6) - r3m, r4*Cos(wo6), fhr};
 Point(11120) = {r4*Sin(wo6), r4*Cos(wo6) , fhr - gt};
 Point(11121) = {r4*Sin(wo6), r4*Cos(wo6) + r3m,  fhr - gt - r3m/Tan(wb)};
 Point(11122) = {r4*Sin(wo6) + r3m, r4*Cos(wo6),  fhr - gt - r3m/Tan(wb)};
 Point(11123) = {r4*Sin(wo6), r4*Cos(wo6) - r3m , fhr - gt - r3m/Tan(wb)};
 Point(11124) = {r4*Sin(wo6) - r3m, r4*Cos(wo6),  fhr - gt - r3m/Tan(wb)};
 Point(11125) = {r4*Sin(wo6), r4*Cos(wo6) , fhr - gt - r3m/Tan(wb)};
Circle(11120) = {11111, 11110, 11112};
Circle(11121) = {11112, 11110, 11113};
Circle(11122) = {11113, 11110, 11114};
Circle(11123) = {11114, 11110, 11111};
Circle(11220) = {11121, 11125, 11122};
Circle(11221) = {11122, 11125, 11123};
Circle(11222) = {11123, 11125, 11124};
Circle(11223) = {11124, 11125, 11121};
Line(11310)   = {11121, 11120};
Line(11311)   = {11122, 11120};
Line(11312)   = {11123, 11120};
Line(11313)   = {11124, 11120};
Line(11314)   = {11121, 11111};
Line(11315)   = {11122, 11112};
Line(11316)   = {11123, 11113};
Line(11317)   = {11124, 11114};



// links
// 1.Gewinde
 Point(12110) = {r4*Sin(wo1), r4*Cos(wo1) , fhl};
 Point(12111) = {r4*Sin(wo1), r4*Cos(wo1) + r3m , fhl};
 Point(12112) = {r4*Sin(wo1) + r3m, r4*Cos(wo1), fhl};
 Point(12113) = {r4*Sin(wo1), r4*Cos(wo1) - r3m , fhl};
 Point(12114) = {r4*Sin(wo1) - r3m, r4*Cos(wo1), fhl};
Circle(12120) = {12111, 12110, 12112};
Circle(12121) = {12112, 12110, 12113};
Circle(12122) = {12113, 12110, 12114};
Circle(12123) = {12114, 12110, 12111};
 Point(12120) = {r4*Sin(wo1), r4*Cos(wo1) , fhl + gt};
 Point(12121) = {r4*Sin(wo1), r4*Cos(wo1) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(12122) = {r4*Sin(wo1) + r3m, r4*Cos(wo1),  fhl + gt + r3m/Tan(wb)};
 Point(12123) = {r4*Sin(wo1), r4*Cos(wo1) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(12124) = {r4*Sin(wo1) - r3m, r4*Cos(wo1),  fhl + gt + r3m/Tan(wb)};
 Point(12125) = {r4*Sin(wo1), r4*Cos(wo1) ,       fhl + gt + r3m/Tan(wb)};
Circle(12220) = {12121, 12125, 12122};
Circle(12221) = {12122, 12125, 12123};
Circle(12222) = {12123, 12125, 12124};
Circle(12223) = {12124, 12125, 12121};
 Line(12310) = {12121, 12120};
 Line(12311) = {12122, 12120};
 Line(12312) = {12123, 12120};
 Line(12313) = {12124, 12120};
 Line(12314) = {12121, 12111};
 Line(12315) = {12122, 12112};
 Line(12316) = {12123, 12113};
 Line(12317) = {12124, 12114};

// links
// 2.Gewinde
 Point(13110) = {r4*Sin(wo2), r4*Cos(wo2) , fhl};
 Point(13111) = {r4*Sin(wo2), r4*Cos(wo2) + r3m , fhl};
 Point(13112) = {r4*Sin(wo2) + r3m, r4*Cos(wo2), fhl};
 Point(13113) = {r4*Sin(wo2), r4*Cos(wo2) - r3m , fhl};
 Point(13114) = {r4*Sin(wo2) - r3m, r4*Cos(wo2), fhl};
 Point(13120) = {r4*Sin(wo2), r4*Cos(wo2) , fhl + gt};
 Point(13121) = {r4*Sin(wo2), r4*Cos(wo2) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(13122) = {r4*Sin(wo2) + r3m, r4*Cos(wo2),  fhl + gt + r3m/Tan(wb)};
 Point(13123) = {r4*Sin(wo2), r4*Cos(wo2) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(13124) = {r4*Sin(wo2) - r3m, r4*Cos(wo2),  fhl + gt + r3m/Tan(wb)};
 Point(13125) = {r4*Sin(wo2), r4*Cos(wo2) ,       fhl + gt + r3m/Tan(wb)};
Circle(13120) = {13111, 13110, 13112};
Circle(13121) = {13112, 13110, 13113};
Circle(13122) = {13113, 13110, 13114};
Circle(13123) = {13114, 13110, 13111};
Circle(13220) = {13121, 13125, 13122};
Circle(13221) = {13122, 13125, 13123};
Circle(13222) = {13123, 13125, 13124};
Circle(13223) = {13124, 13125, 13121};
  Line(13310) = {13121, 13120};
  Line(13311) = {13122, 13120};
  Line(13312) = {13123, 13120};
  Line(13313) = {13124, 13120};
  Line(13314) = {13121, 13111};
  Line(13315) = {13122, 13112};
  Line(13316) = {13123, 13113};
  Line(13317) = {13124, 13114};

// links
// 3.Gewinde
 Point(14110) = {r4*Sin(wo3), r4*Cos(wo3) , fhl};
 Point(14111) = {r4*Sin(wo3), r4*Cos(wo3) + r3m , fhl};
 Point(14112) = {r4*Sin(wo3) + r3m, r4*Cos(wo3), fhl};
 Point(14113) = {r4*Sin(wo3), r4*Cos(wo3) - r3m , fhl};
 Point(14114) = {r4*Sin(wo3) - r3m, r4*Cos(wo3), fhl};
 Point(14120) = {r4*Sin(wo3), r4*Cos(wo3) , fhl + gt};
 Point(14121) = {r4*Sin(wo3), r4*Cos(wo3) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(14122) = {r4*Sin(wo3) + r3m, r4*Cos(wo3),  fhl + gt + r3m/Tan(wb)};
 Point(14123) = {r4*Sin(wo3), r4*Cos(wo3) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(14124) = {r4*Sin(wo3) - r3m, r4*Cos(wo3),  fhl + gt + r3m/Tan(wb)};
 Point(14125) = {r4*Sin(wo3), r4*Cos(wo3) ,       fhl + gt + r3m/Tan(wb)};
Circle(14120) = {14111, 14110, 14112};
Circle(14121) = {14112, 14110, 14113};
Circle(14122) = {14113, 14110, 14114};
Circle(14123) = {14114, 14110, 14111};
Circle(14220) = {14121, 14125, 14122};
Circle(14221) = {14122, 14125, 14123};
Circle(14222) = {14123, 14125, 14124};
Circle(14223) = {14124, 14125, 14121};
  Line(14310) = {14121, 14120};
  Line(14311) = {14122, 14120};
  Line(14312) = {14123, 14120};
  Line(14313) = {14124, 14120};
  Line(14314) = {14121, 14111};
  Line(14315) = {14122, 14112};
  Line(14316) = {14123, 14113};
  Line(14317) = {14124, 14114};

// links
// 4.Gewinde
 Point(15110) = {r4*Sin(wo4), r4*Cos(wo4) , fhl};
 Point(15111) = {r4*Sin(wo4), r4*Cos(wo4) + r3m , fhl};
 Point(15112) = {r4*Sin(wo4) + r3m, r4*Cos(wo4), fhl};
 Point(15113) = {r4*Sin(wo4), r4*Cos(wo4) - r3m , fhl};
 Point(15114) = {r4*Sin(wo4) - r3m, r4*Cos(wo4), fhl};
 Point(15120) = {r4*Sin(wo4), r4*Cos(wo4) , fhl + gt};
 Point(15121) = {r4*Sin(wo4), r4*Cos(wo4) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(15122) = {r4*Sin(wo4) + r3m, r4*Cos(wo4),  fhl + gt + r3m/Tan(wb)};
 Point(15123) = {r4*Sin(wo4), r4*Cos(wo4) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(15124) = {r4*Sin(wo4) - r3m, r4*Cos(wo4),  fhl + gt + r3m/Tan(wb)};
 Point(15125) = {r4*Sin(wo4), r4*Cos(wo4) ,       fhl + gt + r3m/Tan(wb)};
Circle(15120) = {15111, 15110, 15112};
Circle(15121) = {15112, 15110, 15113};
Circle(15122) = {15113, 15110, 15114};
Circle(15123) = {15114, 15110, 15111};
Circle(15220) = {15121, 15125, 15122};
Circle(15221) = {15122, 15125, 15123};
Circle(15222) = {15123, 15125, 15124};
Circle(15223) = {15124, 15125, 15121};
  Line(15310) = {15121, 15120};
  Line(15311) = {15122, 15120};
  Line(15312) = {15123, 15120};
  Line(15313) = {15124, 15120};
  Line(15314) = {15121, 15111};
  Line(15315) = {15122, 15112};
  Line(15316) = {15123, 15113};
  Line(15317) = {15124, 15114};
 
// links
// 5.Gewinde
 Point(16110) = {r4*Sin(wo5), r4*Cos(wo5) , fhl};
 Point(16111) = {r4*Sin(wo5), r4*Cos(wo5) + r3m , fhl};
 Point(16112) = {r4*Sin(wo5) + r3m, r4*Cos(wo5), fhl};
 Point(16113) = {r4*Sin(wo5), r4*Cos(wo5) - r3m , fhl};
 Point(16114) = {r4*Sin(wo5) - r3m, r4*Cos(wo5), fhl};
 Point(16120) = {r4*Sin(wo5), r4*Cos(wo5) , fhl + gt};
 Point(16121) = {r4*Sin(wo5), r4*Cos(wo5) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(16122) = {r4*Sin(wo5) + r3m, r4*Cos(wo5),  fhl + gt + r3m/Tan(wb)};
 Point(16123) = {r4*Sin(wo5), r4*Cos(wo5) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(16124) = {r4*Sin(wo5) - r3m, r4*Cos(wo5),  fhl + gt + r3m/Tan(wb)};
 Point(16125) = {r4*Sin(wo5), r4*Cos(wo5) ,       fhl + gt + r3m/Tan(wb)};
Circle(16120) = {16111, 16110, 16112};
Circle(16121) = {16112, 16110, 16113};
Circle(16122) = {16113, 16110, 16114};
Circle(16123) = {16114, 16110, 16111};
Circle(16220) = {16121, 16125, 16122};
Circle(16221) = {16122, 16125, 16123};
Circle(16222) = {16123, 16125, 16124};
Circle(16223) = {16124, 16125, 16121};
  Line(16310) = {16121, 16120};
  Line(16311) = {16122, 16120};
  Line(16312) = {16123, 16120};
  Line(16313) = {16124, 16120};
  Line(16314) = {16121, 16111};
  Line(16315) = {16122, 16112};
  Line(16316) = {16123, 16113};
  Line(16317) = {16124, 16114};

// links
// 6.Gewinde
 Point(17110) = {r4*Sin(wo6), r4*Cos(wo6) , fhl};
 Point(17111) = {r4*Sin(wo6), r4*Cos(wo6) + r3m , fhl};
 Point(17112) = {r4*Sin(wo6) + r3m, r4*Cos(wo6), fhl};
 Point(17113) = {r4*Sin(wo6), r4*Cos(wo6) - r3m , fhl};
 Point(17114) = {r4*Sin(wo6) - r3m, r4*Cos(wo6), fhl};
 Point(17120) = {r4*Sin(wo6), r4*Cos(wo6) , fhl + gt};
 Point(17121) = {r4*Sin(wo6), r4*Cos(wo6) + r3m,  fhl + gt + r3m/Tan(wb)};
 Point(17122) = {r4*Sin(wo6) + r3m, r4*Cos(wo6),  fhl + gt + r3m/Tan(wb)};
 Point(17123) = {r4*Sin(wo6), r4*Cos(wo6) - r3m , fhl + gt + r3m/Tan(wb)};
 Point(17124) = {r4*Sin(wo6) - r3m, r4*Cos(wo6),  fhl + gt + r3m/Tan(wb)};
 Point(17125) = {r4*Sin(wo6), r4*Cos(wo6) ,       fhl + gt + r3m/Tan(wb)};
Circle(17120) = {17111, 17110, 17112};
Circle(17121) = {17112, 17110, 17113};
Circle(17122) = {17113, 17110, 17114};
Circle(17123) = {17114, 17110, 17111};
Circle(17220) = {17121, 17125, 17122};
Circle(17221) = {17122, 17125, 17123};
Circle(17222) = {17123, 17125, 17124};
Circle(17223) = {17124, 17125, 17121};
  Line(17310) = {17121, 17120};
  Line(17311) = {17122, 17120};
  Line(17312) = {17123, 17120};
  Line(17313) = {17124, 17120};
  Line(17314) = {17121, 17111};
  Line(17315) = {17122, 17112};
  Line(17316) = {17123, 17113};
  Line(17317) = {17124, 17114};
