// make roads by Jim Lemon // World copyright © 2007 All Rights Reserved startshape roads background {b -1 sat 0 h 0} rule roads { segment_test_2{} } rule segment_test_2{ // draw the ballast-es, with gore LLnegnegcurvedsegmentPaint{}; LL30negnegcurvedsegmentPaint{}; LL30negnegcurvedsegmentBallast0{}; LLnegnegcurvedsegmentBallast0{}; LL30negnegcurvedsegmentBallast{}; LLnegnegcurvedsegmentBallast{}; LRposposcurvedsegment{x 0}; URposnegcurvedsegment{x 0 y 11}; ULnegposcurvedsegment{y 11}; LL30negnegcurvedsegment{x -11.34 y 2.89 s -1 -1}; } // short radius curves rule LLnegnegcurvedsegment { 45*{ x -0.2 r -2} road {} } rule LLnegnegcurvedsegmentPaint { 45*{ x -0.2 r -2} paintlines {} } rule LLnegnegcurvedsegmentBallast { 45*{ x -0.2 r -2} ballast {} } rule LLnegnegcurvedsegmentBallast0 { 45*{ x -0.2 r -2} ballast0 {} } rule ULnegposcurvedsegment { 45*{ x -0.2 r 2} road {} } rule URposnegcurvedsegment { 45*{ x 0.2 r -2} road {} } rule LRposposcurvedsegment { 45*{ x 0.2 r 2} road {} } rule poscurvedsegment { 45*{ x 0.2 r 2} road {} } // long radius curves rule LL30negnegcurvedsegment { 30*{ x -0.2 r -1} road {} } rule LL30negnegcurvedsegmentBallast { 30*{ x -0.2 r -1} ballast {} } rule LL30negnegcurvedsegmentBallast0 { 30*{ x -0.2 r -1} ballast0 {} } rule LL30negnegcurvedsegmentPaint { 30*{ x -0.2 r -1} paintlines {} } // straight segments rule posYsegment { possegment{r 90} } rule negYsegment { possegment{r -90} } rule possegment { 30*{ x 0.2} road {} } rule negsegment { 30*{ x -0.2} road {} } // basic road parts rule road { // render from the bottom up, the famous painter's algorithm paintlines{} // the centerline ballast{} // the right-of-way, roadbed, gravel } rule ballast { SQUARE{ s 0.23 1.1 b 0.9 sat 0 h 0} // outer concrete SQUARE{ s 0.23 1 b 0.7 sat 0 h 0} // outer gravel SQUARE{ s 0.24 0.87 b 0.5 sat 0 h 0} // middle gravel } rule ballast0 { SQUARE{ s 0.24 0.87 b 0.5 sat 0 h 0} // middle gravel } rule paintlines { //SQUARE{ x 0.10 s 0.02 0.02 b 1 sat 0 h 0} // center highlight SQUARE{ x 0 s 0.14 0.03 b 0.8 sat 0.5 h 60} // center highlight //SQUARE{ x 0 y 0.38 s 0.24 0.03 b 0.5 sat 1 h 60} // upper SQUARE{ x 0 y 0.38 s 0.24 0.01 b 1 sat 0 h 0} // upper highlight //SQUARE{ x 0 y -0.38 s 0.24 0.03 b 0.5 sat 1 h 60} // lower SQUARE{ x 0 y -0.38 s 0.24 0.01 b 1 sat 0 h 0} // lower highlight }