1asset footbridge "Footbridge" complexity=4
2// a timber footbridge arching over a stream: plank treads on a gentle hump carried by two log
3// stringers, stone abutments at both ends, rail posts and a curved handrail each side, fat
4// newel posts at the corners
5let W = 1.5..1.7
6let plankA = oak:3|honey|driftwood
7let postC = walnut:2|barkB|redwood
8let stoneC = rockGrey:3|granite|rockCool
9
10// the treads: thirteen planks on an arch along z
11box plank x13 at=(0, .35+.45*(1-(2*t-1)*(2*t-1)), (t-.5)*5.4) tilt=(2*t-1)*18 size=(W, .1, .38) round=.03 color=sel(i, plankA, plankA*.92, plankA*1.04, plankA*.96, plankA, plankA*.92, plankA*1.04, plankA*.96, plankA, plankA*.92, plankA*1.04, plankA*.96, plankA)
12
13// the log stringers under the plank ends, the stone abutments
14tube stringer pts=[.6,.18,-2.95 .6,.56,-1.45 .6,.7,0 .6,.56,1.45 .6,.18,2.95] mirror r=.11 smooth sides=8 color=postC
15ball abut x2 row=(0, 0, 5.6) r=(W*.62, .42, .55) half sq=3 noise=.08 color=stoneC segs=14 rings=6
16
17// rails: posts, a curved handrail, newels at the corners
18cyl rpost x5 at=(W*.5+.08, .4+.45*(1-(1.6*t-.8)*(1.6*t-.8)), (t-.5)*4.4) mirror h=1.05 r=.06 color=postC segs=8
19tube handrail at=(W*.5+.08, 0, 0) pts=[0,1.42,-2.75 0,1.72,-1.3 0,1.82,0 0,1.72,1.3 0,1.42,2.75] mirror r=.065 smooth sides=8 color=plankA
20cyl newel x2 row=(0, 0, 5.6) at=(W*.5+.08, .28, 0) mirror h=1.25 r=.1 round=.03 color=postC cap=honey segs=12
21ball knob on=newel at=end r=.11 color=postC*1.1 segs=10 rings=6
22