1asset server_rack "Server rack" complexity=4
2// a tall server rack: a dark cabinet on a plinth with a vented top and a perforated door frame, eight
3// slim server units stacked inside, each with a row of status lights that blink out of step, a bundle
4// of colourful cables looping out of the side and a fan on top; front faces +Z
5let S = .97..1.03
6let caseC = navy:3|iron:2|grape
7let unitC = inkDark:2|iron
8let ledA = lime:3|mint|aqua
9let ledB = sky:2|sunflower|aqua
10
11// the cabinet
12box plinth size=(.68, .08, .9)*S round=.02 color=inkDark
13box case on=plinth at=(0, .08, 0) size=(.66, 1.9, .88)*S round=.04 bev=2 color=caseC
14box crown on=case at=(0, 1.9*S, 0) size=(.6, .06, .8)*S round=.02 color=caseC*1.15
15box rim at=(.3*S, .14, .45*S) mirror size=(.05, 1.78, .03)*S round=.012 color=caseC*1.25
16cyl fan on=crown at=(0, .06, .1) h=.03 r=.14 color=silver segs=20 joint
17box blade x3 on=fan ring at=(.075, .035+i*.005, 0) size=(.13, .012, .05) round=.01 color=iron
18
19// eight server units with their lights
20box unit x8 on=case at=(0, .14*S+.84*S, .43*S) row=(0, .21*S, 0) size=(.54*S, .16*S, .03) round=.015 bands=[.5:unitC*1.2] color=unitC
21box grill on=unit at=(.12*S, .04*S, .02) size=(.22*S, .08*S, .012) round=.006 color=iron*1.4 ink=none
22ball led x3 on=unit at=(-.2*S, .08*S, .025) row=(.045, 0, 0) r=.017 color=sel(i, ledA, ledB, ledA) ink=glow segs=8 rings=5 joint
23
24// a cable bundle looping out of the right side
25tube cable x3 on=case at=(.33*S, 1.5*S, .2*S) row=(0, 0, .05) pts=[0,0,0 .1,-.1,0 .12,-.5,0 .05,-1.2,0 0,-1.4,0] r=.022 smooth sides=6 color=sel(i, cherry, sunflower, cobalt)
26
27anim led s keys=[0:0 .45:0 .5:-.85 .7:-.85 .75:0 1:0] hz=1.3 stagger=.37
28anim fan ry spin hz=1.5
29