//A truck - AOFX at this point. Will later be adapted for container wagon of some sort. //One POV unit = 1m. //<0,0,0> in all #declared objects (where possible) is the logical center of that object *at rail level*. Rotations should work OK in the Y dimension only; no guarantees about other rotations. #include "bogie.inc" //Definition of standard freight bogie (XCS Type I) #declare Cars_ANR_AOFX=union { object {Bogie_XCS_I translate <-6.66,0,0>} object {Bogie_XCS_I translate <+6.66,0,0>} difference { box {<-8.535,1,-1.450>,<8.535,2.620,1.450>} box {<-8.425,1.250,-1.340>,<8.425,2.621,1.340>} pigment {rgbt <.7,.62,.2,0>} } } #declare Cars_VR_VHQY=union { #declare estbasethickness=.15; #declare estabovecurvethickness=.15; box {<-6.172,1.089,-1.3435>,<6.172,1.089-estbasethickness,1.3435>} object {Bogie_XCS_I translate <-4.648,0,0>} object {Bogie_XCS_I translate <+4.648,0,0>} box {<-4.086,3.315,-1.2571>,<4.086,3.315-estabovecurvethickness,1.2571>} difference { #declare estcurvecentre=2; #declare estcurveaspectratio=1.25; cylinder {<-4.086,estcurvecentre,0>,<4.086,estcurvecentre,0>,2.969/2 scale <1,estcurveaspectratio,1>} plane {y,0 translate <0,1.089,0>} plane {-y,0 translate <0,3.315-estabovecurvethickness,0>} } #declare ladder=union //0=outside of ladder, bottom, half way between legs { #declare estrungspacing=.4; #declare estladderwidth=.3; #declare estvertdepth=.05; #declare estvertwidth=.01; #declare estladderbasex=8.172/2+.835; #declare estladderlength=sqrt((3.315-1.089)*(3.315-1.089)+(estladderbasex-8.172/2)*(estladderbasex-8.172/2)); //diff two squares - first half is height-height=height of ladder; second is one fifth of difference between body length and superstructure length (estimated delta x of ladder) #declare estfirstrungheight=.25; #declare estrungradius=.01; box {<0,0,-estladderwidth/2>,} box {<0,0,+estladderwidth/2>,} #declare i=0; #while (i<6) cylinder {<0,i*estrungspacing+estfirstrungheight,-estladderwidth/2>,<0,i*estrungspacing+estfirstrungheight,estladderwidth/2>,estrungradius} #declare i=i+1; #end } object {ladder rotate +z*degrees(acos((3.315-1.089)/estladderlength)) translate } object {ladder rotate -z*degrees(acos((3.315-1.089)/estladderlength)) translate <-estladderbasex,1.089,0>} pigment {color rgb <.5,0,0>} } /* CFCLA's CQEY: Length 14.5m, load 2x20' CFCLA's CQCY: Length 14.6m, load 2x20', deck height 1130mm VFKX, VFTY, VHQY, VMBX possible - wagon leaflets */