/* D van, PH van Dims of PH measured 23/05/2002: End->door 1.5, door 1.8, btwn doors approx 5.2 Louvre height .2, depth (Z) .005 Roof->1st louvre .15 10 louvres Louvres->bottom .3 Width similar to H cars */ #ifndef (gauge) #error "Must #declare gauge before using D_PHVan.inc\n" #end #ifndef (D_PHVanIncluded) #declare D_PHVanIncluded=1; #include "bogie.inc" #local estBogieCtr=8; //Distance between bogie centers - guessed based on total length #local estTotalWidth=2.9; //Educated guess #local msrLouvreDepth=.05; #local clcBodyWidth=estTotalWidth-2*msrLouvreDepth; #local msrOutsideDoorLength=1.5; #local msrDoorLength=1.8; #local msrBetweenDoorsLength=5.2; //Not exact #local clcTotalLength=msrOutsideDoorLength+msrDoorLength+msrBetweenDoorsLength+msrDoorLength+msrOutsideDoorLength; #local clcOuterPanelCenter=msrBetweenDoorsLength/2+msrDoorLength+msrOutsideDoorLength/2; #local clcSideDoorCenter=msrBetweenDoorsLength/2+msrDoorLength/2; #local estBottomHeight=1; #local msrBelowLouvres=.3; #local msrLouvreHeight=.2; #local msrNumLouvres=10; #local msrAboveLouvres=.15; #local clcRoofHeight=estBottomHeight+msrBelowLouvres+msrLouvreHeight*msrNumLouvres+msrAboveLouvres; #local msrLouvreFlatSpotHeight=.05; #local Louvre=difference { box {<-1,0,0>,<1,-msrLouvreHeight,-msrLouvreDepth>} //"1" is a real number because this obj will be scaled to fit the space. plane {z,0 rotate x*(90-degrees(atan2(msrLouvreHeight-msrLouvreFlatSpotHeight,msrLouvreDepth)))} } #local livery=0; #while (livery<=2) #switch (livery) #case (0) #local MainPigment=pigment {color rgb .75} #declare Cars_PH_VLP0=union #break #case (1) #local MainPigment=pigment {color rgb .75} #declare Cars_PH_VLP1=union #break #else #declare Cars_PH_VLP2=union #end { box {<-clcTotalLength/2,estBottomHeight,-clcBodyWidth/2>,} object {Bogie_XCS_I translate x*estBogieCtr/2} object {Bogie_XCS_I translate -x*estBogieCtr/2} #local PH_LouvrePanels=union { #local i=1; #while (i<=msrNumLouvres) object {Louvre scale translate <0,estBottomHeight+msrBelowLouvres+msrLouvreHeight*i,-clcBodyWidth/2>} object {Louvre scale translate <+clcOuterPanelCenter,estBottomHeight+msrBelowLouvres+msrLouvreHeight*i,-clcBodyWidth/2>} object {Louvre scale translate <-clcOuterPanelCenter,estBottomHeight+msrBelowLouvres+msrLouvreHeight*i,-clcBodyWidth/2>} object {Louvre scale rotate -90*y translate } #declare i=i+1; #end } object {PH_LouvrePanels} object {PH_LouvrePanels rotate 180*y} #local Diaphragm=union { #local estDiaphragmLength=.075; #local estDiaphragmBarThickness=.05; #local estDiaphragmBetweenBars=1.2; //Distance between the insides box {,} box {,} } object {Diaphragm} object {Diaphragm rotate 180*y} #local SideDoor=union { #local estDoorThickness=.1; box {,<-msrDoorLength/2,clcRoofHeight-msrAboveLouvres,clcBodyWidth/2+estDoorThickness>} } object {SideDoor translate x*clcSideDoorCenter} object {SideDoor translate -x*clcSideDoorCenter} object {SideDoor rotate 180*y translate x*clcSideDoorCenter} object {SideDoor rotate 180*y translate -x*clcSideDoorCenter} pigment {color rgb .75} } #switch (livery) #case (0) #declare Cars_D_VLP0=union #break #case (1) #declare Cars_D_VLP1=union #break #else #declare Cars_D_VLP2=union #end { box {<-clcTotalLength/2,estBottomHeight,-clcBodyWidth/2>,} object {Bogie_XCS_I translate x*estBogieCtr/2} object {Bogie_XCS_I translate -x*estBogieCtr/2} #local D_LouvrePanels=union { #local i=1; #while (i<=msrNumLouvres) object {Louvre scale translate <0,estBottomHeight+msrBelowLouvres+msrLouvreHeight*i,-clcBodyWidth/2>} object {Louvre scale rotate -90*y translate } #declare i=i+1; #end } object {D_LouvrePanels} object {D_LouvrePanels rotate 180*y} object {Diaphragm} object {Diaphragm rotate 180*y} pigment {color rgb .75} } #declare livery=livery+1; #end //while loop #end //inclusion protection