/*

    Kabinenentwurf 4:

    (für Aufteilung: 12 m Zentrale, 30 m Kabinen)

    Äußerer Kabinenblock: Offizierskabinen:

    Innenradius 11.0 m, Außenradius 15.0, 
    4 Blöcke á 6 Kabinen
    12 m² pro Kabine

 */

#declare eps=1E-3;

#declare Gw = asin(1/11)*45/atan2(1,1);
#declare Kw = (90 - 2 * Gw) / 4;
#declare H = 2.9;

#include "einrichtung.pov"

#declare kabine4 = 
    union {
	intersection {
	    union {
		difference {
		    cylinder {
			<0, 0, 0>
			<0, H, 0>
			15.0
		    }
		    cylinder {
			<0, 0-eps, 0>
			<0, H+eps, 0>
			14.9
		    }
		}
		// Innenwand (mit Aussparung für Schott)
		difference {
		    cylinder {
			<0, 0, 0>
			<0, H, 0>
			11.1
		    }
		    cylinder {
			<0, 0-eps, 0>
			<0, H+eps, 0>
			11.0
		    }
		    superellipsoid {
			<0.2, 0.2>
			scale <0.5, 1, 1>
			translate <0, 1, 11>
		    }
		}
		// Schott
		intersection {
		    difference {
			cylinder {
			    <0, 0, 0>
			    <0, H, 0>
			    11.08
			}
			cylinder {
			    <0, 0-eps, 0>
			    <0, H+eps, 0>
			    11.02
			}
		    }
		    superellipsoid {
			<0.2, 0.2>
			scale <0.5, 1, 1>
			translate <0, 1, 11>
		    }
		    texture {
			pigment {
			    color <0.9, 1.0, 0.8>
			}
		    }
		}
	    }
	    plane {
		<-1, 0, 0>,
		0
		rotate <0, -Kw/2, 0>
	    }
	    plane {
		<+1, 0, 0>
		0
		rotate <0, +Kw/2, 0>
	    }
	}
	box {
	    <0, 0, 11>
	    <0.05, H, 15>
	    rotate <0, -Kw/2, 0>
	}
	box {
	    <0, 0, 11>
	    <-0.05, H, 15>
	    rotate <0, +Kw/2, 0>
	}

	object {
	    bett
	    rotate <0, 90, 0>
	    translate <-1, 0, 13.1>
	    rotate <0, Kw/2, 0>
	}
	object {
	    spind
	    rotate <0, 90, 0>
	    translate <-0.6, 0, 13.9>
	    rotate <0, Kw/2, 0>
	}
	object {
	    spind
	    rotate <0, -90, 0>
	    translate <+0.6, 0, 13.1>
	    rotate <0, -Kw/2, 0>
	}
	object {
	    bett
	    rotate <0, 90, 0>
	    translate <+0, 0, 13.1>
	    rotate <0, -Kw/2, 0>
	}
	union {
	    object {
		tisch 
	    }
	    object {
		stuhl
		translate <0.5, 0, 0>
		rotate <0, 0, 0>
	    }
	    object {
		stuhl
		translate <0.5, 0, 0>
		rotate <0, 120, 0>
	    }
	    object {
		stuhl
		translate <0.5, 0, 0>
		rotate <0, 240, 0>
	    }
	    rotate <0, 90, 0>
	    translate <0, 0, 12.5>
	}

	// Bad
	intersection {
	    difference {
		cylinder {
		    <0, 0, 0>
		    <0, H, 0>
		    14.01
		}
		cylinder {
		    <0, 0-eps, 0>
		    <0, H+eps, 0>
		    14.0
		}
		texture {
		    pigment {
			color rgbf <1, 1, 1, 0.5>
		    }
		}
	    }
	    plane {
		<-1, 0, 0>,
		0
		rotate <0, -Kw/2, 0>
	    }
	    plane {
		<+1, 0, 0>
		0
		rotate <0, -0.2*Kw, 0>
	    }
	}
	box {
	    <0, 0, 14>
	    <0.01, H, 15>
	    rotate <0, -0.2*Kw, 0>
	    texture {
		pigment {
		    color rgbf <1, 1, 1, 0.5>
		}
	    }
	}

	object {
	    duschwanne
	    rotate <0, -90, 0>
	    translate <0, 0, 14.5>
	    rotate <0, -0.4*Kw, 0>
	}

	object {
	    waschbecken
	    rotate <0, -90, 0>
	    translate <0, 0, 14.9>
	    rotate <0, -0.3*Kw, 0>
	}


	// Klo
	intersection {
	    difference {
		cylinder {
		    <0, 0, 0>
		    <0, H, 0>
		    14.01
		}
		cylinder {
		    <0, 0-eps, 0>
		    <0, H+eps, 0>
		    14.0
		}
		texture {
		    pigment {
			color rgbf <1, 1, 1, 0.5>
		    }
		}
	    }
	    plane {
		<-1, 0, 0>,
		0
		rotate <0, +0.3*Kw, 0>
	    }
	    plane {
		<+1, 0, 0>
		0
		rotate <0, +0.5*Kw, 0>
	    }
	}
	box {
	    <0, 0, 14>
	    <0.01, H, 15>
	    rotate <0, +0.3*Kw, 0>
	    texture {
		pigment {
		    color rgbf <1, 1, 1, 0.5>
		}
	    }
	}

	object {
	    klo
	    rotate <0, 0, 0>
	    translate <0, 0, 14.70>
	    rotate <0, +0.45*Kw, 0>
	}



	texture {
	    pigment {
		color <0.8, 1.0, 0.8>
	    }
	}
    }


