Tree Synth

Tree Synthesis

Some Tree synthesis code. The inspiration was Sakura Synthesis by David C. Pearson .The following scripts are modification of example script given in Structure Synth.

Tree 6

//Tree 6

set maxdepth 500

10 * { y -0.5 sat 1 color #ccc} box 4 * { ry 90 sat 1 } spiral

rule spiral w 100 md 300 > spiral2 { { color #ccc } box { y 0.2 ry 1 rz 1 rx 1.5 s 0.993 } spiral

} rule spiral2 md 50 > flower { { color #ccc } box { y 0.5 rx 2.5 s 0.993 } spiral2

} rule spiral w 1 { spiral { ry 180 z 0.5 rx 45 rz 0 } spiral

} rule flower { 1 * { y 0.75 s 4 } 8 * { ry 45 } petal

ball

} rule petal { { x 0.45 rz 25 s 1 0.05 0.35 color #f09 } box } rule ball { { s 1.75 y 0.5 sat 1 color #f60 } sphere }

Smiley face

Tree7

//Tree 7

set maxdepth 280

1 * { h 200 } 10 *{ ry 10 y -0.5 sat 1 } box 1 * { h 200 } 4 * { ry 90 sat 1} spiral

rule spiral w 100 md 60 > flower { box { y 0.55 ry 10 rz 1.5 rx 1.5 s 0.99 } spiral

} rule spiral w 5 { spiral { ry 180 z 0.5 rx 45 h 3 } spiral

} rule flower { 1 * { h 210 y 0.2 } 8 * { ry 45 } petal

ball

} rule petal { { x 0.75 rz 25 s 1 0.05 0.5} box } rule ball { { s 0.65 sat 1 h 90 } sphere }

Smiley face

Tree 9

// Tree 9

set colorpool list:#66f,#6cf,#3cf,#0cf,#39f

set maxdepth 370

10 * { y -1 color #663 } box 1 * { ry 45 color #663 } 10 * { y -1 } box 8 * { ry 45 } spiral

rule spiral w 100 md 220 > spiral2 { { color #663 } box { y 0.2 rz 0 rz -0.75 s 0.995 } spiral

} rule spiral2 md 70 > leaf { { color #663 } box { y 0.2 rz 0.5 rx 1 s 0.995 } spiral2

} rule spiral w 1 { spiral { ry 90 rx 0 } spiral

} rule leaf { 1 * { h 50 y 0.5 s 2.25 color random } 8 * { ry 45 } leaf1

1 * { ry 22.5 y 0.45 s 1 color #0f5 } 8 * { ry 45 } petal

{ y 0.75 s 0.25 } pstem

{ y 0.75 s 0.25 } pstem

{ y 0.75 s 0.25 } pstem

} rule petal { { x 0.45 rz -45 s 1 0.05 0.5 } box } rule leaf1 { { x 0.75 rz 25 s 1 0.05 0.5 } box } rule ball { { s 3.5 y 0 color #fdd } sphere } rule pstem { pstem1 } rule pstem { pstem2 } rule pstem { pstem3 } rule pstem { pstem4 } rule pstem { pstem5 } rule pstem1 md 20 > ball { { y 0.5 rx 3 rz 4 ry 3 s 0.993 color #f60 } pstem1

box } rule pstem2 md 20 > ball { { y 0.5 rx -2 rz 3 ry 3.5 s 0.993 color #f60 } pstem2

box } rule pstem3 md 20 > ball { { y 0.5 rx -4 rz 2.5 ry -3 s 0.993 color #f60 } pstem3

box } rule pstem4 md 20 > ball { { y 0.5 rx 1.5 rz -3.5 ry 1.5 s 0.993 color #f60 } pstem4

box } rule pstem5 md 20 > ball { { y 0.5 rx 1.5 rz -1.5 ry -1.5 s 0.993 color #f60 } pstem5

box }

Smiley face

Spiral Tree 1

//Spiral Tree 1

set maxdepth 520

{ h 30 sat 0.7 } stem

rule stem md 20 { box { y -1 } stem

} { h 30 sat 0.7 } spiral

{ ry 180 h 30 sat 0.7 } spiral

rule spiral w 1 { spiral { ry 180 h 3 } spiral

} rule spiral w 100 md 500 > leaf{

box { y 0.4 rz 1 s 0.995 } spiral

} rule leaf { { s 10.5 10.5 1 rz 45 h 60 } box }

Smiley face

Spiral Tree 2

//Spiral Tree 2 , use seed 11

set maxdepth 520

{ h 100 sat 0.8 } stem

rule stem md 20 { box { y -1 } stem

} { h 100 sat 0.8 } spiral

{ ry 180 h 100 sat 0.8 } spiral

rule spiral w 1 { spiral { ry 180 h 3 } spiral

} rule spiral w 100 md 400 > leaf { { y 0.4 rz 2.5 s 0.995 } spiral

box } rule leaf { { s 7.5 7.5 1 rz 45 h 60 } box }

Smiley face