Lantern lamp, explained · celworld

Lantern lamp

.cel · 38 lines · 21 shapes · seed 1

Lantern lamp is 24 shape lines that grow into 21 shapes, with 12 genes the seed draws.

lamp@0's lantern form: a stepped plinth, a tapered post with collars, a capital, and a four-sided lantern (tray, glowing panes, corner bars, pyramid roof, finial); sometimes a flower basket or a banner on an arm

seed
L1

Lantern lamp

asset
1asset lamp_lantern "Lantern lamp" ref=prop:lamp:lantern complexity=3

The asset line names the model lamp_lantern, titled Lantern lamp. complexity=3 holds it to 45 shapes, 4,500 triangles and 3 draw calls; going past any of them is an error. ref=prop:lamp:lantern pairs it with a hand-coded generator for side-by-side comparison.

tier
c3
shapes cap
45
triangles cap
4,500
seed
1
L5

PH

let
5let PH = 2.7..3.3

A gene, PH: a value drawn between 2.7 and 3.3 for every seed. This seed picked 3.156. Every line that reads PH follows it.

this seed
3.156
draws
from the seed
L6

PR

let
6let PR = .06..0.075

A gene, PR: a value drawn between 0.06 and 0.075 for every seed. This seed picked 0.071. Every line that reads PR follows it.

this seed
0.071
draws
from the seed
L7

BH

let
7let BH = .4..0.6

A gene, BH: a value drawn between 0.4 and 0.6 for every seed. This seed picked 0.402. Every line that reads BH follows it.

this seed
0.402
draws
from the seed
L8

BR

let
8let BR = .15..0.19

A gene, BR: a value drawn between 0.15 and 0.19 for every seed. This seed picked 0.181. Every line that reads BR follows it.

this seed
0.181
draws
from the seed
L9

HR

let
9let HR = .17..0.22

A gene, HR: a value drawn between 0.17 and 0.22 for every seed. This seed picked 0.22. Every line that reads HR follows it.

this seed
0.22
draws
from the seed
L10

cw

let
10let cw = 0:3|1:3|2:2|3:1.5|4:1.5|5|6|7:.6

A gene, cw: a weighted pick from 0 (3 in 13.6), 1 (3 in 13.6), 2 (2 in 13.6), 3 (1.5 in 13.6), 4 (1.5 in 13.6), 5, 6 or 7 (0.6 in 13.6). This seed picked 5.

this seed
5
draws
from the seed
L11

frameC

let
11let frameC = sel(cw, iron, bottle, navy, cherry, teal, white, aqua, brass)~

A gene, frameC: worked out from a random draw: sel(cw, iron, bottle, navy, cherry, teal, white, aqua, brass)~. This seed picked white.

this seed
white
draws
from the seed
L12

trimC

let
12let trimC = sel(cw, brass, brass, white, cream, cream, sky, copper, iron)~

A gene, trimC: worked out from a random draw: sel(cw, brass, brass, white, cream, cream, sky, copper, iron)~. This seed picked sky.

this seed
sky
draws
from the seed
L13

pane

let
13let pane = glow:4|cream:2|white

A gene, pane: a weighted pick from glow (4 in 7), cream (2 in 7) or white. This seed picked glow.

this seed
glow
draws
from the seed
L14

accA

let
14let accA = cherry:2|pink:2|sunflower:2|grape:1.5|coral:1.5|cobalt|tangerine:1.5|lilac

A gene, accA: a weighted pick from cherry (2 in 12.5), pink (2 in 12.5), sunflower (2 in 12.5), grape (1.5 in 12.5), coral (1.5 in 12.5), cobalt, tangerine (1.5 in 12.5) or lilac. This seed picked grape.

this seed
grape
draws
from the seed
L15

accB

let
15let accB = cherry:2|pink:2|sunflower:2|grape:1.5|coral:1.5|cobalt|tangerine:1.5|lilac

A gene, accB: a weighted pick from cherry (2 in 12.5), pink (2 in 12.5), sunflower (2 in 12.5), grape (1.5 in 12.5), coral (1.5 in 12.5), cobalt, tangerine (1.5 in 12.5) or lilac. This seed picked tangerine.

this seed
tangerine
draws
from the seed
L16

extra

let
16let extra = "none":2|"basket":1.4|"banner"

A gene, extra: a weighted pick from none (2 in 4.4), basket (1.4 in 4.4) or banner. This seed picked banner.

this seed
banner
draws
from the seed
L19

plinth

lathe
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

A lathe, a profile spun round Y: pots, bodies, columns, domes, bells (base at the origin). It stands at the model's origin.

the post

h
0.402
r
0.181
prof
[0:1 .28:1 .28:.8 .72:.72 .72:.58 1:PR*1.25/BR]
linear
yes
bands
[.28:trimC .36:frameC]
color
white
segs
14
L20

post

cyl
20cyl post at=(0, BH-.03, 0) h=PH-BH+.03 r=PR r2=PR*.82 flare=1.1 color=frameC segs=12

A cyl, a cylinder (or tapered drum) with rounded edges, base at the origin. It stands at the model's origin.

h
2.784
r
0.071
r2
0.058
flare
1.1
color
white
segs
12
L21

collar

cyl
21cyl collar at=(0, PH*.56, 0) h=.07 r=PR*.9+.02 color=trimC segs=12

A cyl, a cylinder (or tapered drum) with rounded edges, base at the origin. It stands at the model's origin.

h
0.07
r
0.084
color
sky
segs
12
L22

collar2

cyl
22cyl collar2 at=(0, PH-.1, 0) h=.06 r=PR*.83+.018 color=frameC segs=12

A cyl, a cylinder (or tapered drum) with rounded edges, base at the origin. It stands at the model's origin.

h
0.06
r
0.077
color
white
segs
12
L23

capital

cone
23cone capital at=(0, PH-.02, 0) h=.08 r=PR*.9 r2=PR*1.75 color=frameC segs=12

A cone, a cone (or frustum with r2), base at the origin. It stands at the model's origin.

h
0.08
r
0.064
r2
0.125
color
white
segs
12
L24

neck

cone
24cone neck at=(0, PH+.06, 0) h=.08 r=PR*1.5 r2=PR*1.18 color=trimC segs=10

A cone, a cone (or frustum with r2), base at the origin. It stands at the model's origin.

h
0.08
r
0.107
r2
0.084
color
sky
segs
10
L27

tray

box
27box tray at=(0, PH+.12, 0) size=(HR*1.84, .05, HR*1.84) round=.02 color=frameC

A box, a rounded box standing on the origin (true fillets, crisp colour cuts). It stands at the model's origin.

the lantern

size
0.404, 0.05, 0.404
round
0.02
color
white
L28

panes

box
28box panes at=(0, PH+.17, 0) size=(HR*1.52, HR*2.5, HR*1.52) round=.03 color=pane

A box, a rounded box standing on the origin (true fillets, crisp colour cuts). It stands at the model's origin.

size
0.334, 0.549, 0.334
round
0.03
color
glow
L29

bar

box
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

A box, a rounded box standing on the origin (true fillets, crisp colour cuts). It rides panes, at (HR*1.075, -.01, 0) in its frame. 4 copies spread evenly round panes's Y axis.

copies
4
size
0.044, 0.569, 0.044
round
0.014
color
white
L30

plate

box
30box plate on=panes at=(0, HR*2.5-.01, 0) size=(HR*2.04, .06, HR*2.04) round=.022 color=frameC

A box, a rounded box standing on the origin (true fillets, crisp colour cuts). It rides panes, at (0, HR*2.5-.01, 0) in its frame.

size
0.448, 0.06, 0.448
round
0.022
color
white
L31

roof

cone
31cone roof on=plate at=(0, .06, 0) h=HR*.95 r=HR*1.42 segs=4 panels=4 phase=45 color=frameC

A cone, a cone (or frustum with r2), base at the origin. It rides plate, at (0, .06, 0) in its frame.

h
0.209
r
0.312
segs
4
panels
4
phase
45
color
white
L32

finial

ball
32ball finial on=roof at=(0, HR*.95, 0) r=.045 color=trimC segs=8 rings=6

A ball, an ellipsoid centred on the origin. It rides roof, at (0, HR*.95, 0) in its frame.

r
0.045, 0.045, 0.045
color
sky
segs
8
rings
6
L35

arm

rod
35rod arm at=(0, PH*.6, 0) to=(.36, 0, 0) r=.018 sides=6 color=frameC if=extra=="basket"

A rod, a straight bar from the origin to to, flat ends: poles, legs, rails, spokes. It stands at the model's origin. Only when extra=="basket".

a flower basket on an arm

copies
0
to
(.36, 0, 0)
r
.018
sides
6
L36

brace

rod
36rod brace on=arm at=(0, -.12, 0) to=(.2, .12, 0) r=.014 sides=6 color=frameC

A rod, a straight bar from the origin to to, flat ends: poles, legs, rails, spokes. It rides arm, at (0, -.12, 0) in its frame.

copies
0
to
(.2, .12, 0)
r
.014
sides
6
L37

armknob

ball
37ball armknob on=arm at=end r=.025 color=trimC segs=6 rings=4

A ball, an ellipsoid centred on the origin. It sits at the end of arm.

copies
0
r
.025
segs
6
rings
4
L38

chain

rod
38rod chain x3 on=arm at=end ring to=(.17, -.32, 0) r=.007 sides=4 color=frameC

A rod, a straight bar from the origin to to, flat ends: poles, legs, rails, spokes. It sits at the end of arm. 0 copies spread evenly round arm's Y axis.

copies
0
to
(.17, -.32, 0)
r
.007
sides
4
L39

bowl

lathe
39lathe bowl on=arm at=end+(0, -.49, 0) h=.17 r=.2 prof=[0:0 1:1] color=wicker segs=12

A lathe, a profile spun round Y: pots, bodies, columns, domes, bells (base at the origin). It sits at the end of arm, nudged by an offset.

copies
0
h
.17
r
.2
prof
[0:0 1:1]
segs
12
L40

leaves

puff
40puff leaves on=bowl at=(0, .21, 0) r=(.24, .15, .24) color=leaf noise=.08 segs=12 rings=7

A puff, a foliage blob: ball with a darker underside band (color × .86) and wobble 0.06. It rides bowl, at (0, .21, 0) in its frame.

copies
0
r
(.24, .15, .24)
noise
.08
segs
12
rings
7
L41

trail

puff
41puff trail x3 on=bowl ring ring0=25 at=(.16, .03, 0) r=(.08, .13, .08) color=leaf noise=.05 segs=8 rings=5

A puff, a foliage blob: ball with a darker underside band (color × .86) and wobble 0.06. It rides bowl, at (.16, .03, 0) in its frame. 0 copies spread evenly round bowl's Y axis.

copies
0
r
(.08, .13, .08)
noise
.05
segs
8
rings
5
L42

bloom

ball
42ball bloom x12 on=leaves ring=6 surf=(0, 15..55) upright lift=-.01 r=.042 color=accA:2|accB segs=6 rings=4

A ball, an ellipsoid centred on the origin. It sticks to the surface of leaves at (0, 15..55) (azimuth, elevation). 0 copies spread evenly round leaves's Y axis.

copies
0
lift
-.01
r
.042
segs
6
rings
4
L45

BD

let
45let BD = min(PH*.34, 1)

A named value, BD = min(PH*.34, 1), which comes to 1. Lines below can use the name.

or a banner on two arms

this seed
1
L46

barm

rod
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"

A rod, a straight bar from the origin to to, flat ends: poles, legs, rails, spokes. It stands at the model's origin. 2 copies in a centred row, (0, BD, 0) apart and only when extra=="banner".

copies
2
to
0.52, 0, 0
r
0.016, 0.016
sides
6
color
white
L47

bknob

ball
47ball bknob on=barm at=end r=.026 color=trimC segs=6 rings=4

A ball, an ellipsoid centred on the origin. It sits at the end of barm. There is a set on each of the 2 barm copies, 2 in all.

copies
2
r
0.026, 0.026, 0.026
color
sky
segs
6
rings
4
L48

flag

box
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"

A box, a rounded box standing on the origin (true fillets, crisp colour cuts). It stands at the model's origin. Only when extra=="banner".

size
0.349, 0.94, 0.024
round
0.01
bands
[.21:accB .29:accA]
color
grape
L49

crest

cyl
49cyl crest on=flag at=(0, (BD-.06)*.64, -.022) rot=(90, 0, 0) h=.044 r=(.42-PR)*.25 color=trimC segs=16

A cyl, a cylinder (or tapered drum) with rounded edges, base at the origin. It rides flag, at (0, (BD-.06)*.64, -.022) in its frame.

rot
(90, 0, 0)
h
0.044
r
0.087
color
sky
segs
16