# L-System scene generator
# Cmpt 461 Final Project
# Allen Pike, apike@sfu.ca

# This program takes an L-System definition, and outputs a .pbrt scene file of that model.
# The .pbrt scene file can be included into a master scene file and rendered with the
# raytracer pbrt.

## Todo:
# Implement command-line arguments.
# Make stochastic tree.
# Make field of stochastic trees.

# Default values.

import random
import sys

n = 4
delta = 22
axiom = 'F'
productions = {}

cylRadius = 0.1 # Initial radius of segments.
leafRadius = 0.05 # Radius of leaf segments.
shrinkFactor = 1.4 # Shrinking effect of branching.

print 'Texture "b" "color" "imagemap" "string filename" "bark.exr"'
print 'Texture "l" "color" "imagemap" "string filename" "leaf.exr"'

bark = 'Material "matte" "texture Kd" "b"'
leaf = 'Material "matte" "texture Kd" "l"'

# L-System definitions.
# Comment out one of these to have it generate that L-System.

#p10-a: Koch curve
n = 4
delta = 90.0
axiom = "F-F-F-F"