Hide
Siafoo is here to make coding less frustrating and to save you time. Join Siafoo Now or Learn More

Nodebox Commands Tutorial, Flower Function Atom Feed 0

In Brief A code sample drawn from the Nodebox Commands Tutorial. It demonstrates the ability of Nodebox users to define their own python-style functions to improve the encapsulation of repeated drawing operations.... more
# 's
 1size(400,400)
2
3def flower(x,y):
4
5 fill(random(0.5,1), 0, random(0.5))
6 stroke(0.2)
7 strokewidth(1)
8
9 transform(CORNER)
10 translate(x,y)
11
12 for i in range(10):
13 rotate(36)
14 line(0,0,15,15)
15 oval(10,10,10,10)
16 reset()
17
18
19for i in range(60):
20 flower(random(WIDTH),
21 random(HEIGHT))

A code sample drawn from the Nodebox Commands Tutorial. It demonstrates the ability of Nodebox users to define their own python-style functions to improve the encapsulation of repeated drawing operations.

http://www.siafoo.net/image/89