#include "ein-mann-jaeger.pov"
#include "sonden_hangar.pov"

#declare emj_hangar_schott_offen = 0;
#declare emj_hangar =
    union {
	cylinder {
	    <0, 0, 12> <0, 0.01, 12>, 8
	    pigment { 
		color rgb <1, 1, 0>
	    }
	}
	difference {
	    union {
		cylinder {
		    <0, 0, 12> <0, 4.8, 12>, 8.05
		    pigment { 
			color rgbf <1, 1, 1, 0.0>
		    }
		}
		intersection {
		    superellipsoid {
			<0.25 0.25>
			scale <8.05, 2.4, 40>
			translate <0, 2.4, 0>
		    }
		    box {
			<-8.05, 0, 12> <8.05, 4.8, 22>
		    }
		    texture {
			T_arkonstahl
		    }
		}

	    }
	    // Hohlraum:
	    // Hohlraum: Hangar
	    cylinder {
		<0, 0, 12> <0, 4.81, 12>, 8.00
		pigment { 
		    color rgbf <1, 1, 1, 0.0>
		}
	    }
	    // Hohlraum: Ausflugöffnung
	    prism {
		linear_sweep
		linear_spline
		12	// min y
		30  // max y
		8	// nr points
		<-1, 0> <-5.1, 1> <-1, 2> <0, 4.6>
		<1, 2> <5.1, 1> <1, 0>
		<-1, 0>
		rotate <-90, 0, 0>	// +x -> +x, +z -> +y, +y -> -z
		scale <1, 1, -1>
		texture {
		    T_arkonstahl
		}
	    }

	}
	// Schott: 4 Teile
	box {
	    <0, 0, 20.5> <5.5, 2.0, 21>
	    pigment { 
		gradient y
		color_map {
		    [0.5 color Yellow ]
		    [0.5 color Black ]
		}
		scale 0.4
		rotate <0, 0, 45>
		translate <0, 2, 0>
	    }
	    translate <2.5, 1.5, 0>*emj_hangar_schott_offen
	}
	box {
	    <0, 0, 20.5> <5.5, 2.0, 21>
	    pigment { 
		gradient y
		color_map {
		    [0.5 color Yellow ]
		    [0.5 color Black ]
		}
		scale 0.4
		rotate <0, 0, 45>
		translate <0, 2, 0>
	    }
	    translate <2.5, 1.5, 0>*emj_hangar_schott_offen
	    scale <-1, 1, 1>
	}
	box {
	    <0, 2, 20.5> <1.5, 4.6, 21>
	    pigment { 
		gradient y
		color_map {
		    [0.5 color Yellow ]
		    [0.5 color Black ]
		}
		scale 0.4
		rotate <0, 0, -45>
	    }
	    translate <1.0, 0.0, 0>*emj_hangar_schott_offen
	}
	box {
	    <0, 2, 20.5> <1.5, 4.6, 21>
	    pigment { 
		gradient y
		color_map {
		    [0.5 color Yellow ]
		    [0.5 color Black ]
		}
		scale 0.4
		rotate <0, 0, -45>
	    }
	    translate <1.0, 0.0, 0>*emj_hangar_schott_offen
	    scale <-1, 1, 1>
	}
	#if (1)
	object {
	    ein_mann_jaeger 
	    translate <0, 0, 5>
	}
	#end
    }



#declare deck_19 = 
    union {
	#if (1)
	intersection {
	    union {
		difference {
		    object { huelle }
		    // Ausschnitt f. Hangartore
		    superellipsoid {
			<0.25 0.25>
			scale <8.05, 2.4, 40>
			translate <0, 40+2.4, 0>
			pigment { 
			    color rgb <1, 1, 0>
			}
		    }
		    superellipsoid {
			<0.25 0.25>
			scale <8.05, 2.4, 40>
			translate <0, 40+2.4, 0>
			rotate <0, 90, 0>
			pigment { 
			    color rgb <1, 1, 0>
			}
		    }
		}
	    }
	    box {
		<-50, 45, -50>
		< 50, 40,  50>
	    }
	}
	#end
	difference {
	    cone {
		<0, 40.0, 0> 28
		<0, 39.0, 0> 30
	    }
	    // AG
	    cylinder {
		<0, 38, 0> <0, 41, 0> 2
	    }
	    #ifdef (SCHNITT_1)
	    intersection {
		torus {
		    26, 5
		}
		plane { 
		    <0, 0, -1> 0
		    rotate <0, 45, 0>
		}
		plane { 
		    <0, 0, +1> 0
		    rotate <0, -45, 0>
		}
		rotate <0, 135, 0>
		translate <0, 39.5, 0>
	    }
	    #end
	    texture { T_arkonstahl }
	}
	object {
	    emj_hangar
	    translate <0, 40, 0>
	    rotate <0, 0, 0>
	}
	object {
	    emj_hangar
	    translate <0, 40, 0>
	    rotate <0, 90, 0>
	}
	object {
	    emj_hangar
	    translate <0, 40, 0>
	    rotate <0, 180, 0>
	}
	object {
	    emj_hangar
	    translate <0, 40, 0>
	    rotate <0, 270, 0>
	}

	object {
	    sonden_hangar
	    translate <0, 40, 0>
	    rotate <0, 0, 0>
	}
	object {
	    sonden_hangar
	    translate <0, 40, 0>
	    rotate <0, 90, 0>
	}
	object {
	    sonden_hangar
	    translate <0, 40, 0>
	    rotate <0, 180, 0>
	}
	object {
	    sonden_hangar
	    translate <0, 40, 0>
	    rotate <0, 270, 0>
	}
    }
