scale=40;

durchmesserled=30.5;

r_facets = rands(6,10,1)[0];
facets=r_facets;

r_height = rands(1,2,1)[0];
// r_height = rands(2,4,1)[0];

height=r_height;
r_plane = rands(0,10,1)[0];
plane=r_plane;
r_top = rands(1,2,0)[0];
top=1;
r_cut = rands(0,16,1)[0];
cut=r_cut;
half=scale/2;
$fn=facets;

// Rock Generator
module shape1() {
translate([0,0,-10]){
    // Base model
        union(){
            translate([0,0,0])
                cylinder(h=scale*height-cut,d1=scale,d2=half*3);
            translate([0,0,0+scale*height-cut])
                cylinder(h=(half*2)/top,d1=half*3,d2=plane);
        }
}
};
difference() {
shape1();
scale([0.95,0.95,0.95]) shape1();
translate([0,0,-20]){
    $fn=0;
    cylinder(h = 20, d = durchmesserled);
}
}

// Socket
translate([50,0,-5]){
    difference(){
        cylinder(h=10,d1=scale*1,d2=scale*1, center= true);
            union(){
                $fn=0;
                translate([0,0,-4])
                    cylinder(h=10,d1=30.5,d2=30.5);
            }
    }
}

// Socket inlay
translate([0,0,-5]){
    difference(){
        cylinder(h=10,d1=scale*1,d2=scale*1, center= true);
            union(){
                $fn=0;
                translate([0,0,-5])
                    cylinder(h=10,d1=30.5,d2=30.5);
            }
    }
}