// Mensch
// Bounding-Box: <-0.50, 0, -0.20>, <0.50, 1.75, 0.20>
// Blickrichtung -z

#declare BR = .65
#declare BS = 3
#declare BD = BS*pow((1-pow(BR,2)),2)

#declare R_BECKEN  = 0.100
#declare H_BECKEN  = 0.800
#declare R_AB_X	   = 0.100
#declare R_AB_Y	   = 0.100
#declare R_AB_Z	   = 0.070
#declare K_AB_X	   = 0.080
#declare K_AB_Y	   = 0.030
#declare K_AB_Z	   = 0.020
#declare L_OS	   = 0.400
#declare R_OS	   = 0.080
#declare R_OK	   = 0.040
#declare A_OS_X	   = 0
#declare A_OS_Y	   = 0
#declare A_OS_Z	   = 0
#declare R_K_X	   = 0.020
#declare R_K_Y	   = 0.040
#declare R_K_Z	   = 0.020
#declare L_US	   = 0.320
#declare R_UK	   = 0.040
#declare A_US_X	   = -0		// always use negative values!
#declare A_US_Y	   = 0		// should be 0
#declare A_US_Z	   = 0		// should be 0
#declare L_FERSE   = 0.030
#declare H_FERSE   = -0.050
#declare R_FERSE   = 0.030
#declare L_MFUSS   = 0.140
#declare H_MFUSS   = -0.060
#declare L_ZEHEN   = 0.070
#declare A_FUSS_X  = 0
#declare A_FUSS_Y  = 0
#declare A_FUSS_Z  = 0		// should be about 0

#declare K_WSU_Z   = 0.050
#declare K_WSO_Z   = 0.080
#declare K_WSO_Y   = 0.350

#declare K_BU_Z   = 0.000
#declare K_BO_Z   = 0.000
#declare K_BO_Y   = 0.350
#declare R_B_X    = 0.100
#declare R_B_Z    = 0.070

#declare K_RU_X   = 0.050
#declare K_RU_Y   = 0.100
#declare K_RU_Z   = 0.000
#declare K_RO_X   = 0.130
#declare K_RO_Y   = 0.450
#declare K_RO_Z   = 0.050
#declare R_R_X    = 0.080
#declare R_R_Y    = 0.020
#declare R_R_Z    = 0.060
#declare A_R_X    = -5
#declare A_R_Z    = 10

#declare R_N_X    = 0.200
#declare R_N_Y    = 0.040
#declare R_N_Z    = 0.050
#declare K_N_Y    = 0.430
#declare K_N_Z    = 0.040

#declare K_HU_X   = 0.000
#declare K_HU_Y   = 0.450
#declare K_HU_Z   = 0.050
#declare K_HO_X   = 0.000
#declare K_HO_Y   = 0.550
#declare K_HO_Z   = 0.050
#declare R_H_X    = 0.050
#declare R_H_Y    = 0.050
#declare R_H_Z    = 0.060
#declare A_H_X    = 0
#declare A_H_Z    = 0


#declare mensch =
    blob {
	threshold BD


	// linke seite
	#declare LR = 1
	#include "bein.inc"

	// rechte seite
	#declare LR = -1
	#include "bein.inc"


/*
	// wirbelsäule
	cylinder {
	    <0, 0, K_WSU_Z>
	    <0, K_WSO_Y, K_WSO_Z>
	    0.02/BR
	    BS
	}
*/


	// bauch
	cylinder {
	    <0, 0, K_BU_Z>
	    <0, K_BO_Y, K_BO_Z>
	    R_B_Z/BR
	    BS
	    scale <R_B_X/R_B_Z, 1, 1>
	}

	// rücken
	cylinder {
	    <-0, K_RU_Y, 0>
	    <-0, K_RO_Y, 0>
	    R_R_Y/BR
	    BS
	    scale <R_R_X/R_R_Y, R_R_Y/R_R_Y, R_R_Z/R_R_Y>
	    rotate <-A_R_X, 0>
	    rotate <0, 0, -A_R_Z>
	    translate <+K_RU_X, 0, K_RU_Z>
	}
	cylinder {
	    <-0, K_RU_Y, 0>
	    <-0, K_RO_Y, 0>
	    R_R_Y/BR
	    BS
	    scale <R_R_X/R_R_Y, R_R_Y/R_R_Y, R_R_Z/R_R_Y>
	    rotate <-A_R_X, 0>
	    rotate <0, 0, A_R_Z>
	    translate <-K_RU_X, 0, K_RU_Z>
	}

	#if (1)
	// nacken
	sphere {
	    <0, 0, 0>
	    1/BR
	    BS
	    scale <R_N_X, R_N_Y, R_N_Z>
	    translate <0, K_N_Y, K_N_Z>
	}
	#end

	// hals
	cylinder {
	    <-0, K_HU_Y, 0>
	    <-0, K_HO_Y, 0>
	    R_H_Y/BR
	    BS
	    scale <R_H_X/R_H_Y, R_H_Y/R_H_Y, R_H_Z/R_H_Y>
	    rotate <-A_H_X, 0>
	    rotate <0, 0, A_H_Z>
	    translate <-K_HU_X, 0, K_HU_Z>
	    texture { pigment { color  Red } }
	}

	texture { pigment { color  White } }
	translate <0, H_BECKEN, 0>
    }
