startshape FOO
rule FOO{
LEAF[]
STEM[s .1 .3 hue 0 saturation .4 b .5]
//FOO2[x 5 s .99 r 10]
}
rule FOO2 .01 {
FOO[flip 15]
}
rule FOO2 .01 {
FOO[flip -15]
}
rule LEAF{
REDI[z 1 s .8 r -90 h 90 b .6 saturation 1]
REDI[z 1 s 1.2 r -45 h 90 b .6 saturation 1]
REDI[z 1 s 1.3 r 0 h 90 b .6 saturation 1]
REDI[z 1 s 1.5 r 45 h 90 b .6 saturation 1]
REDI[z 1 s 1.3 r 90 h 90 b .6 saturation 1]
REDI[z 1 s 1.2 r 135 h 90 b .6 saturation 1]
REDI[z 1 s .8 r 180 h 90 b .6 saturation 1]
}
rule REDI{
TRIANGLE[ r 20 s .7]
RED[]
}
rule RED{
REDI[x .2 y .2 s .91 r 3]
}
rule RED{
REDI[x .2 y .2 s .91 r -3]
}
rule STEM{
CIRCLE[s 2]
CIRCLE[y -1 s 2]
CIRCLE[y -2 s 2]
CIRCLE[y -3 s 2]
CIRCLE[y -4 s 2]
CIRCLE[y -5 s 2]
CIRCLE[y -6 s 2]
CIRCLE[y -7 s 2]
}
nice little pot leaf, came out farily well i guess, for my first one anyway
theres some worthless code in there, cause i was trying to make a whole plant, but havent figured out how to place the leaves yet... and its time to leave work so...
startshape MAIN
rule MAIN {
col{ y 0 x 0 z 0 s 1}
col{ y 3 x -2 z -.1 s 1}
col{ y 6 x -4 z -.1 s 1}
col{ y 9 x -6 z -.1 s 1}
col{ y 12 x -8 z -.1 s 1}
col{ y 15 x -10 z -.1 s 1}
col{ y 18 x -12 z -.1 s 1}
col{ y 21 x -14 z -.1 s 1}
col{ y 24 x -16 z -.1 s 1}
col{ y 27 x -18 z -.1 s 1}
col{ y 30 x -20 z -.1 s 1}
col{ y 33 x -22 z -.1 s 1}
col{ y 36 x -24 z -.1 s 1}
col{ y 39 x -26 z -.1 s 1}
col{ y 42 x -28 z -.1 s 1}
}
rule col {
row{}
row{ y 3 x 2 z -.1 s 1}
row{ y 6 x 4 z -.1 s 1}
row{ y 9 x 6 z -.1 s 1}
row{ y 12 x 8 z -.1 s 1}
row{ y 15 x 10 z -.1 s 1}
row{ y 18 x 12 z -.1 s 1}
row{ y 21 x 14 z -.1 s 1}
row{ y 24 x 16 z -.1 s 1}
row{ y 27 x 18 z -.1 s 1}
row{ y 30 x 20 z -.1 s 1}
row{ y 33 x 22 z -.1 s 1}
row{ y 36 x 24 z -.1 s 1}
row{ y 39 x 26 z -.1 s 1}
row{ y 42 x 28 z -.1 s 1}
//col{ y 3 x -2 z -.1 s 1}
}
//rule col .1 {
//}
rule row {
box{}
///row{ y 3 x 2 z -.1 s 1}
}
//rule row .1 {
//box{}
//}
rule box {
SQUARE{x 1 s 2 1 r 0 skew 0 45 b 1 sat .9 h 250 a 1 z 1}
SQUARE{x -1 s 2 1 r 0 skew 0 -45 b 1 sat .9 h 350 a 1 z 1}
SQUARE{y 1 x 1 s 2 1 r 0 skew 0 45 b 1 sat .9 h 250 a 1 z 1}
SQUARE{y 1 x -1 s 2 1 r 0 skew 0 -45 b 1 sat .9 h 350 a 1 z 1}
TOP{ y 2 }
}
rule TOP{
SQUARE{y 0 s 2 1 r 0 skew 45 -45 b 1 sat .9 h 150 a 1 z .99}
}
There are some Context Free features that can save you a lot of work: loops and order-dependent adjustments. Your Q-bert design can be shrunk down to this:
startshape MAIN
rule MAIN {
15* {y -1.555 x 1 z -0.1 } col { }
}
rule col {
15* {y 1.555 x 1 z -0.1 } box {s 1.111 1}
}
rule box {
SQUARE [r 15 skew 15 15 x 0.5 y -0.5 sat 0.9 b 1 h 250]
SQUARE [r 135 skew 15 15 x 0.5 y -0.5 sat 0.9 b 1 h 150]
SQUARE [r 255 skew 15 15 x 0.5 y -0.5 sat 0.9 b 1 h 350]
}
The loop syntax replaces your 15 col and row shapes with one 15x loop. The SQUARE shapes in the box rule use square brackets instead of curly brackets. This allows you to control the order of the shape adjustments. This lets you make the three diamond shapes without having to do a lot of trig. Read more about it here.