1asset stalagmite "Stalagmite cluster" complexity=3
2// a cave-floor cluster: one tall stalagmite and a ring of shorter ones on a rubble base, a
3// little pool at their feet. Seeds change the heights and colours and sometimes crust it with
4// glowing crystals or moss.
5let H = 1.4..2.4
6let rockC = rockCool:2|rockGrey|granite|sandstone
7let crystalC = aqua:2|grape|mint|bubblegum
8let crust = int(0..2)
9
10// rubble base and pool
11ball base r=(.7, .2, .62) half color=rockC*.85 noise=.08 segs=26 rings=9
12ball rock x6 on=base ring ring0=20 at=(.62, .12, 0) r=(.22, .12, .18) rot=(0, 0, 12) color=rockC*.9 noise=.12 segs=10 rings=7
13cyl pool on=base at=(.42, -.0, .62) h=.03 r=.32 color=water segs=16
14
15// the tall one and its smaller siblings
16lathe spire on=base at=(0, .12, 0) h=H r=.32 prof=[0:1 .15:.9 .3:.72 .45:.62 .55:.5 .7:.36 .85:.22 1:.04] color=rockC noise=.05 segs=20 rings=18
17lathe spireB on=base at=(.34, .08, -.22) h=H*.55 r=.2 prof=[0:1 .3:.75 .6:.45 1:.05] color=rockC*.94 noise=.06 segs=14 rings=10
18lathe spireC on=base at=(-.36, .06, .18) h=H*.4 r=.18 prof=[0:1 .4:.65 .7:.35 1:.05] color=rockC*1.04 noise=.06 segs=14 rings=10
19lathe spireD on=base at=(-.18, .06, -.38) h=H*.28 r=.13 prof=[0:1 .5:.55 1:.05] color=rockC segs=8 rings=6
20
21// crust by seed: glowing crystals or moss
22cone crystal x4 on=base ring ring0=45 at=(.42, .12, .12) rot=(0, 0, -25) h=.5 r=.09 color=crystalC ink=glow segs=5 if=crust==0
23cone crystalB on=crystal at=(.04, 0, .03) rot=(15, 0, -20) h=.2 r=.045 color=crystalC ink=glow segs=5
24puff moss x3 on=base ring ring0=60 at=(.45, .14, 0) r=.16 color=sel(i, moss, hedge, lime) segs=7 rings=5 if=crust==1
25cone shard x3 on=spire at=(0, H*.5, 0) chain=(0, H*.1, 0) rot=(0, 120, 70) h=.16 r=.05 color=crystalC ink=glow segs=4 if=crust==2
26
27