
diameter=50;
thickness=2;
length=200;

connector_height = 10;
transition_height = 20;
small_diameter = 10;
base_height = 50;

base_height_2 = 4;

item = 2;
if (item == 1 ) {
  union() {
    difference() {
      cylinder(d=diameter, h=length);
      translate([0,0,-0.1]) cylinder(d=diameter-thickness*2, h=length+0.2);
      for (k = [0:36:780]) {
        rotate([0,0,k]) translate([0,0,k/4])
        for (i = [0:24:360] ) {
          rotate([45/2,90,i]) cylinder(d=10, h=100, $fn=6);
        }
      }
    }
    difference() {
      union() {
        translate([0,0,-5]) cylinder(h=5, d=diameter);
        translate([0,0,-connector_height-5]) cylinder(h=connector_height, d=diameter-thickness*2);
      }
      translate([0,0,-30]) cylinder(h=40, d=diameter-thickness*4);
    }
  }
} else {
  translate([0,0,-16])
  union() {
    // łącznik
    difference() {
      cylinder(d=diameter, h=connector_height);
      translate([0,0,-0.1]) cylinder(d=diameter-thickness*2, h=length+0.2);
    }
    translate([0,0,-transition_height]) {
      difference() {
        cylinder(h=transition_height, d2=diameter, d1=small_diameter);
        translate([0,0,thickness])
          cylinder(h=transition_height, d2=diameter, d1=small_diameter);
      }
    }
    translate([0,0,-transition_height - base_height]) {
      cylinder(h=base_height, d=small_diameter);
      //translate([0,0,-small_diameter]) cylinder(h=small_diameter, d2=small_diameter);
      for (i = [0,90]) {
        rotate([0,0,i])
        translate([-diameter/2,-base_height_2/2,0])
        cube([diameter,base_height_2,base_height_2]);
      }
    }
  }
}