#include "kraftwerk.pov"
#include "treibstofftank.pov"
#include "kabine.pov"

#declare deck_13 = 
    union {
	#if (1)
	intersection {
	    union {
		difference {
		    object { huelle }
		    // Ausschnitte
		}
	    }
	    box {
		<-50, 15, -50>
		< 50, 10,  50>
	    }
	}
	#end
	difference {
	    cone {
		<0, 10.2, 0> 46.6
		<0, 9.8, 0> 46.7
		texture { T_arkonstahl }
	    }
	    #ifdef (SCHNITT_1)
	    intersection {
		torus {
		    23, 23
		}
		plane { 
		    <0, 0, -1> 0
		    rotate <0, 45, 0>
		}
		plane { 
		    <0, 0, +1> 0
		    rotate <0, -45, 0>
		}
		rotate <0, 135, 0>
		translate <0, 10.0, 0>
	    }
	    #end
	}
	torus {
	    15, 0.5
	    translate <0, 10.2, 0>
	    texture { pigment {color rgb <1, 0, 0>}}
	}
	torus {
	    25, 0.5
	    translate <0, 10.2, 0>
	    texture { pigment {color rgb <1, 0, 0>}}
	}
        #local rr = 25.5;
	#while (rr < 40.0) 
	    #local da = degrees(asin(0.5/rr))*2;
	    #local da = 360 / int(360 / da);
	    #local aa = 0;
	    #while (aa <= 360 - da) 
		#local ss = 1;
		#ifdef (SCHNITT_1)
		    #local pp = vrotate(<rr, 0, 0>, <0, aa, 0>);
		    #if (pp.x < 0 & pp.z < 0) 
			#local ss = 0;
		    #end
		#end
		#if (ss) 
		    object {
			treibstofftank
			translate <rr, 10.2, 0>
			rotate <0, aa, 0>
		    }
		#end
		#local aa = aa + da;
	    #end
	    #local rr = rr + 1.0;
	#end

        #local rr = 20;
	#local da = degrees(asin(5/rr))*2;
	#debug concat ("\nDa(1): ", str(da, 0, 0))
	#local da = 360 / int(360 / da);
	#debug concat ("\nDa(2): ", str(da, 0, 0))
	#local aa = 0;
	#while (aa <= 360 - da) 
	    #local ss = 1;
	    #ifdef (SCHNITT_1)
		#local pp = vrotate(<rr, 0, 0>, <0, aa, 0>);
		#if (pp.x < 0 & pp.z < 0) 
		    #local ss = 0;
		#end
	    #end
	    #if (ss) 
		object {
		    turm
		    translate <rr, 10.2, 0>
		    rotate <0, aa, 0>
		}
	    #end
	    #local aa = aa + da;
	#end

	object {
	    kabine1
	    translate <0, 10.2, 0>
	}
	object {
	    kabine1
	    scale <-1, 1, +1>
	    translate <0, 10.2, 0>
	}

	object {
	    kabine1
	    translate <0, 10.2, 0>
	    rotate <0, 90, 0>
	}
	object {
	    kabine1
	    scale <-1, 1, +1>
	    translate <0, 10.2, 0>
	    rotate <0, 90, 0>
	}

	#ifndef (SCHNITT_1)
	object {
	    kabine1
	    translate <0, 10.2, 0>
	    rotate <0, 180, 0>
	}
	#end
	object {
	    kabine1
	    scale <-1, 1, +1>
	    translate <0, 10.2, 0>
	    rotate <0, 180, 0>
	}

	object {
	    kabine1
	    translate <0, 10.2, 0>
	    rotate <0, 270, 0>
	}
	#ifndef (SCHNITT_1)
	object {
	    kabine1
	    scale <-1, 1, +1>
	    translate <0, 10.2, 0>
	    rotate <0, 270, 0>
	}
	#end

    }

