Playground
From carton_xl · Compiles in your browser · $0
CtrlShiftS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
asset carton_xl "Cardboard carton XL" complexity=3// an open cardboard shipping box, 5x4 squares inside (1.5 x 1.2 m), built for the steep packing// camera: a pale inner floor, four walls with lighter corrugated rims and four flaps splayed outward. `pop`// unfolds it from a flat net; `close` folds the short x flaps in, then the long z flaps over them, then a strip// of packing tape rolls out along the seam. A "this side up" mark sits on the front wall and the front lid flaplet boxC = cardboardlet rimC = cardboard*1.16let floorC = cardboard*1.07let tapeC = cardboard*.74let printC = walnutlet labelC = cream// the inner floor and the four walls, each hinged at its bottom edge with +z pointing outwardbox bed at=(0, 0, 0) size=(1.5, .03, 1.2) round=.006 bev=1 color=floorCslab wall_xn at=(-.76, 0, 0) yaw=-90 pts=[-.6,0 .6,0 .6,.25 -.6,.25] t=.02 round=.004 edge=rimC color=boxC jointslab wall_xp at=(.76, 0, 0) yaw=90 pts=[-.6,0 .6,0 .6,.25 -.6,.25] t=.02 round=.004 edge=rimC color=boxC jointslab wall_zn at=(0, 0, -.61) yaw=180 pts=[-.77,0 .77,0 .77,.264 -.77,.264] t=.02 round=.004 edge=rimC color=boxC jointslab wall_zp at=(0, 0, .61) pts=[-.77,0 .77,0 .77,.264 -.77,.264] t=.02 round=.004 edge=rimC color=boxC joint// four top flaps splayed outward: the short x flaps fold in first, the long z flaps close over themslab flap_xn on=wall_xn at=(0, .25, 0) rot=(115, 0, 0) pts=[-.594,0 .594,0 .594,.495 .5929,.505 .5895,.5145 .5842,.5231 .5771,.5302 .5685,.5355 .559,.5389 .549,.54 -.549,.54 -.559,.5389 -.5685,.5355 -.5771,.5302 -.5842,.5231 -.5895,.5145 -.5929,.505 -.594,.495] t=.012 round=.004 edge=rimC color=boxC jointslab flap_xp on=wall_xp at=(0, .25, 0) rot=(115, 0, 0) pts=[-.594,0 .594,0 .594,.495 .5929,.505 .5895,.5145 .5842,.5231 .5771,.5302 .5685,.5355 .559,.5389 .549,.54 -.549,.54 -.559,.5389 -.5685,.5355 -.5771,.5302 -.5842,.5231 -.5895,.5145 -.5929,.505 -.594,.495] t=.012 round=.004 edge=rimC color=boxC jointslab flap_zn on=wall_zn at=(0, .268, 0) rot=(105, 0, 0) pts=[-.758,0 .758,0 .758,.495 .7569,.505 .7535,.5145 .7482,.5231 .7411,.5302 .7325,.5355 .723,.5389 .713,.54 -.713,.54 -.723,.5389 -.7325,.5355 -.7411,.5302 -.7482,.5231 -.7535,.5145 -.7569,.505 -.758,.495] t=.014 round=.004 edge=rimC color=boxC jointslab flap_zp on=wall_zp at=(0, .268, 0) rot=(105, 0, 0) pts=[-.758,0 .758,0 .758,.495 .7569,.505 .7535,.5145 .7482,.5231 .7411,.5302 .7325,.5355 .723,.5389 .713,.54 -.713,.54 -.723,.5389 -.7325,.5355 -.7411,.5302 -.7482,.5231 -.7535,.5145 -.7569,.505 -.758,.495] t=.014 round=.004 edge=rimC color=boxC joint// "this side up": two arrows over a bar, printed on the front wall and on the front lid flap; a label on the back flapslab arrow x2 on=wall_zp at=(0, .1, .011) row=(.09, 0, 0) pts=[-.016,0 .016,0 .016,.07 .042,.07 0,.125 -.042,.07 -.016,.07] t=.004 round=.0015 color=printC ink=noneslab bar on=wall_zp at=(0, .1, .011) pts=[-.1,-.034 .1,-.034 .1,-.016 -.1,-.016] t=.004 round=.0015 color=printC ink=noneslab lidarrow x2 on=flap_zp at=(0, .2, .009) row=(.09, 0, 0) pts=[-.016,0 .016,0 .016,.07 .042,.07 0,.125 -.042,.07 -.016,.07] t=.004 round=.0015 color=printC ink=noneslab lidbar on=flap_zp at=(0, .2, .009) pts=[-.1,-.034 .1,-.034 .1,-.016 -.1,-.016] t=.004 round=.0015 color=printC ink=noneslab label on=flap_zn at=(.3375, .14, .009) pts=[-.1,0 .1,0 .1,.13 -.1,.13] t=.004 round=.0015 color=labelC ink=noneslab line x3 on=label at=(-.012, .065, .004) row=(0, .03, 0) pts=[-.07,-.006 .07,-.006 .07,.006 -.07,.006] t=.003 round=.001 color=printC ink=none// packing tape: baked at 1% size inside the floor; `close` lifts it to the lid seam and rolls it out along +xslab tape at=(-.7, .012, 0) rot=(-90, 0, 0) scale=.01 pts=[0,-.1 1.56,-.1 1.56,.1 0,.1] t=.006 round=.002 color=tapeC ink=thin joint// pop (0.6 s): the walls rise off the flat net with a little overshoot, then the flaps flop out to restanim pop: wall_xn rx keys=[0:90 .12:90 .5:-6 .62:3 .72:0 1:0] hz=1.6667 onceanim pop: wall_xp rx keys=[0:90 .12:90 .5:-6 .62:3 .72:0 1:0] hz=1.6667 onceanim pop: wall_zn rx keys=[0:90 .12:90 .5:-6 .62:3 .72:0 1:0] hz=1.6667 onceanim pop: wall_zp rx keys=[0:90 .12:90 .5:-6 .62:3 .72:0 1:0] hz=1.6667 onceanim pop: flap_xn rx keys=[0:-115 .2:-115 .55:-75 .75:8 .86:-3 1:0] hz=1.6667 onceanim pop: flap_xp rx keys=[0:-115 .2:-115 .55:-75 .75:8 .86:-3 1:0] hz=1.6667 onceanim pop: flap_zn rx keys=[0:-105 .28:-105 .62:-60 .8:6 .9:-2 1:0] hz=1.6667 onceanim pop: flap_zp rx keys=[0:-105 .28:-105 .62:-60 .8:6 .9:-2 1:0] hz=1.6667 once// close (1.2 s): CARTON_FLAP_TIMES x- [0, .22] x+ [.15, .38] z- [.40, .62] z+ [.55, .80] s, tape [.85, 1.05] sanim close: flap_xn rx keys=[0:0 .1833:-205 1:-205] hz=.8333 onceanim close: flap_xp rx keys=[0:0 .125:0 .3167:-205 1:-205] hz=.8333 onceanim close: flap_zn rx keys=[0:0 .3333:0 .5167:-195 1:-195] hz=.8333 onceanim close: flap_zp rx keys=[0:0 .4583:0 .6667:-195 1:-195] hz=.8333 onceanim close: tape px keys=[0:0 .7:0 .705:-.08 1:-.08] hz=.8333 onceanim close: tape pz keys=[0:0 .7:0 .705:.267 1:.267] hz=.8333 onceanim close: tape s keys=[0:0 .7083:0 .875:99 1:99] hz=.8333 once
Clean: no issues on this seed.
seed
Shapes— / 45
Triangles— / 4,500
Draw calls— / 3