1asset balloon_cart "Balloon cart" complexity=4
2// a little balloon seller's cart: a striped box on two wheels with a handle, a tall brass mast, and a
3// bunch of round balloons on strings that bobs and drifts; a few spare balloons tied to the corners
4let L = 1.2..1.35
5let stA = sky:2|teal|mint|lilac
6let stB = white:3|cream
7let trim = cobalt:2|navy|grape
8let metal = brass:3|silver
9let bA = cherry|sunflower|pink|tangerine
10let bB = cobalt|aqua|lime|grape
11let bC = pink|marigold|mint|coral
12
13// the cart
14box body at=(0, .38, 0) size=(L, .66, .74) round=.08 stripes=[stA stB] panels=6 bands=[.86:trim] color=stA
15box top on=body at=(0, .66, 0) size=(L+.08, .07, .82) round=.03 color=trim
16wheel wheel at=(.42, .3, -.1) mirror r=.3 w=.1 hub=stB tyre=trim
17cyl leg on=body at=(0, -.38, .26) h=.38 r=.045 color=metal segs=8
18rod handle on=body at=(L/2-.04, .55, 0) rot=(0, 0, -16) to=(.36, 0, 0) r=.032 sides=6 color=metal
19rod grip on=handle at=end+(0, 0, -.28) to=(0, 0, .56) r=.042 sides=8 color=trim
20
21// the mast and the bunch: one bone that sways, each balloon bobbing on its own
22cyl mast on=top at=(-.2, .07, 0) h=1.6 r=.035 color=metal segs=8
23ball tie on=mast at=end r=.07 color=metal segs=8 rings=5 joint
24ball balloon x6 on=tie ring=10 at=(.32, .55, 0) r=(.25, .3, .25) color=sel(i - 3*floor(i/3), bA, bB, bC) segs=14 rings=10 joint
25ball lead on=tie at=(0, .95, 0) r=(.27, .32, .27) color=bA segs=14 rings=10 joint
26cone knot on=balloon at=(0, -.31, 0) rot=(180, 0, 0) h=.07 r=.05 color=parent.color segs=6
27rod string on=balloon at=(0, -.36, 0) to=(-.3, -.42, 0) r=.02 sides=4 color=stB
28rod string2 on=lead at=(0, -.3, 0) to=(0, -.62, 0) r=.02 sides=4 color=stB
29ball shine on=balloon surf=(30, 35) decal lift=-.01 r=(.06, .09, .03) color=stB ink=none segs=6 rings=4
30
31// two spares tied at the front corners
32rod spare x2 on=top at=(L/2-.05, .07, .3) row=(0, 0, -.6) to=(.08, .75, 0) r=.02 sides=4 color=stB
33ball sball on=spare at=end+(0, .22, 0) r=(.2, .24, .2) color=sel(parent.i, bB, bC) segs=12 rings=8
34
35anim tie rz sin amp=5 hz=.3
36anim tie rx sin amp=3 hz=.23 phase=.3
37anim balloon py sin amp=.05 hz=.5 stagger=.17
38anim lead py sin amp=.06 hz=.45
39