Lantern lamp · celworld
seed

Lantern lamp

lamp_lantern v1Hand-writtenc3
Open in PlaygroundExplain this script

How v1 was made

Hand-written

Written by hand in .cel.

Script
49 lines

Budget

c3 · 49 lines
Shapes21 / 45
Triangles2,052 / 4,500
Draw calls1 / 3
States
None: it rests
Used in
No scene yet
Made
1asset lamp_lantern "Lantern lamp" ref=prop:lamp:lantern complexity=3
2// lamp@0's lantern form: a stepped plinth, a tapered post with collars, a capital, and a
3// four-sided lantern (tray, glowing panes, corner bars, pyramid roof, finial);
4// sometimes a flower basket or a banner on an arm
5let PH = 2.7..3.3
6let PR = .06..0.075
7let BH = .4..0.6
8let BR = .15..0.19
9let HR = .17..0.22
10let cw = 0:3|1:3|2:2|3:1.5|4:1.5|5|6|7:.6
11let frameC = sel(cw, iron, bottle, navy, cherry, teal, white, aqua, brass)~
12let trimC = sel(cw, brass, brass, white, cream, cream, sky, copper, iron)~
13let pane = glow:4|cream:2|white
14let accA = cherry:2|pink:2|sunflower:2|grape:1.5|coral:1.5|cobalt|tangerine:1.5|lilac
15let accB = cherry:2|pink:2|sunflower:2|grape:1.5|coral:1.5|cobalt|tangerine:1.5|lilac
16let extra = "none":2|"basket":1.4|"banner"
17
18// the post
19lathe plinth h=BH r=BR prof=[0:1 .28:1 .28:.8 .72:.72 .72:.58 1:PR*1.25/BR] linear bands=[.28:trimC .36:frameC] color=frameC segs=14
20cyl post at=(0, BH-.03, 0) h=PH-BH+.03 r=PR r2=PR*.82 flare=1.1 color=frameC segs=12
21cyl collar at=(0, PH*.56, 0) h=.07 r=PR*.9+.02 color=trimC segs=12
22cyl collar2 at=(0, PH-.1, 0) h=.06 r=PR*.83+.018 color=frameC segs=12
23cone capital at=(0, PH-.02, 0) h=.08 r=PR*.9 r2=PR*1.75 color=frameC segs=12
24cone neck at=(0, PH+.06, 0) h=.08 r=PR*1.5 r2=PR*1.18 color=trimC segs=10
25
26// the lantern
27box tray at=(0, PH+.12, 0) size=(HR*1.84, .05, HR*1.84) round=.02 color=frameC
28box panes at=(0, PH+.17, 0) size=(HR*1.52, HR*2.5, HR*1.52) round=.03 color=pane
29box bar x4 on=panes ring ring0=45 at=(HR*1.075, -.01, 0) size=(.044, HR*2.5+.02, .044) round=.014 color=frameC
30box plate on=panes at=(0, HR*2.5-.01, 0) size=(HR*2.04, .06, HR*2.04) round=.022 color=frameC
31cone roof on=plate at=(0, .06, 0) h=HR*.95 r=HR*1.42 segs=4 panels=4 phase=45 color=frameC
32ball finial on=roof at=(0, HR*.95, 0) r=.045 color=trimC segs=8 rings=6
33
34// a flower basket on an arm
35rod arm at=(0, PH*.6, 0) to=(.36, 0, 0) r=.018 sides=6 color=frameC if=extra=="basket"
36rod brace on=arm at=(0, -.12, 0) to=(.2, .12, 0) r=.014 sides=6 color=frameC
37ball armknob on=arm at=end r=.025 color=trimC segs=6 rings=4
38rod chain x3 on=arm at=end ring to=(.17, -.32, 0) r=.007 sides=4 color=frameC
39lathe bowl on=arm at=end+(0, -.49, 0) h=.17 r=.2 prof=[0:0 1:1] color=wicker segs=12
40puff leaves on=bowl at=(0, .21, 0) r=(.24, .15, .24) color=leaf noise=.08 segs=12 rings=7
41puff trail x3 on=bowl ring ring0=25 at=(.16, .03, 0) r=(.08, .13, .08) color=leaf noise=.05 segs=8 rings=5
42ball bloom x12 on=leaves ring=6 surf=(0, 15..55) upright lift=-.01 r=.042 color=accA:2|accB segs=6 rings=4
43
44// or a banner on two arms
45let BD = min(PH*.34, 1)
46rod barm x2 at=(0, PH*.52+BD/2, 0) row=(0, BD, 0) to=(.52, 0, 0) r=.016 sides=6 color=frameC if=extra=="banner"
47ball bknob on=barm at=end r=.026 color=trimC segs=6 rings=4
48box flag at=(PR+.06+(.42-PR)/2, PH*.52+.03, 0) size=(.42-PR, BD-.06, .024) round=.01 bands=[.21:accB .29:accA] color=accA if=extra=="banner"
49cyl crest on=flag at=(0, (BD-.06)*.64, -.022) rot=(90, 0, 0) h=.044 r=(.42-PR)*.25 color=trimC segs=16
50