#local Eps = 1E-6;
#include "triebwerk.pov"

#declare ringwulst = 
    union {
	difference {
	    difference {
		union {
		    cylinder {
			<0, -10, 0>
			<0,  10, 0>
			50
		    }
		    torus {
			50, 15
			scale <1, 10/15, 1>
		    }
		}
		cylinder {
		    <0, -10 - Eps, 0>
		    <0,  10 + Eps, 0>
		    15
		}
	    }
	    difference {
		union {
		    cylinder {
			<0, -8, 0>
			<0,  8, 0>
			50
		    }
		    torus {
			50, 13
			scale <1, 8/13, 1>
		    }
		}
		cylinder {
		    <0, -8 - Eps, 0>
		    <0,  8 + Eps, 0>
		    17
		}
	    }
	    box {
		<-100, -100, -100>
		<   0,  100,    0>
	    }
	    #local i = 0;
	    #while (i < 18) 
		#local aa = i * 360 / 18;
		#local ss = 1;
		#ifdef (SCHNITT_1)
		    #local pp = vrotate(<0, 0, 1>, <0, aa, 0>);
		    #if (pp.x < 0 & pp.z < 0) 
			#local ss = 0;
		    #end
		#end
		#if (ss) 
		    object {
			triebwerk_neg
			rotate <0, aa, 0>
		    }
		#end

		#local i = i + 1;
	    #end

	    #if (0)
	    texture {
		crackle 
		texture_map {
		    [ 0.0 T_arkonstahl ]
		    [ 0.2 T_arkonstahl ]
		    [ 0.2 T_luft ]
		    [ 1.0 T_luft ]
		}
	    }
	    #else 
	    texture { T_arkonstahl }
	    #end
	}
	#local i = 0;
	#while (i < 18) 
	    #local aa = i * 360 / 18;
	    #local ss = 1;
	    #ifdef (SCHNITT_1)
		#local pp = vrotate(<0, 0, 1>, <0, aa, 0>);
		#if (pp.x < 0 & pp.z < 0) 
		    #local ss = 0;
		#end
	    #end
	    #if (ss) 
		object {
		    triebwerk
		    rotate <0, aa, 0>
		}
	    #end

	    #local i = i + 1;
	#end
    }
    
