def setup(): """ The processing setup statement """ size(500, 500) background(200, 200, 0) stroke(0, 100, 0) plant0 = grammar.repeat(4, AXIOM, RULES) plant1 = grammar.repeat(5, AXIOM, RULES) plant2 = grammar.repeat(4, AXIOM, RULES) render(plant1) translate(-100, 10) render(plant0) translate(200, 0) render(plant2) print grammar.toRuleString(AXIOM, RULES)
def setup(): """ The processing setup statement """ size(500, 500) global production camera(width/2.0, height/2.0, 600, 0, 0, 0, 0, -1, 0) production = grammar.repeat(3, AXIOM, RULES) noStroke() fill(200, 0, 180)
def setup(): """ Is the processing setup function """ size(500, 500) background(0) stroke(255) production = grammar.repeat(7, AXIOM, RULES) translate(width*0.9, height*0.8) render(production)
def setup(): """ The processing setup statement """ size(600, 600) production = grammar.repeat(8, AXIOM, RULES) background(100, 0, 0) smooth() strokeWeight(3) stroke(YELLOW) render(production)
def setup(): """ The processing setup statement """ size(500, 800) background(200, 200, 0) smooth() fill(190, 10, 10) noStroke() ellipse(300, 250, 180, 180) stroke(0, 100, 0) plant0 = grammar.repeat(4, AXIOM, RULES) plant1 = grammar.repeat(5, AXIOM, RULES) plant2 = grammar.repeat(4, AXIOM, RULES) render(plant1) translate(-100, -5) stroke(200, 100, 100) render(plant0) translate(200, 0) render(plant2) print grammar.toRuleString(AXIOM, RULES)
def evaluateRules(): global production, distance production = grammar.repeat(depth, AXIOM, RULES) if (depth > 0) : distance *= 1/(pow(2, depth) - 1)