2D Fractal Tree

2D fractal Tree

This creates a TWO DIMENSIONAL tree that can be used in creating laser-cut designs

It is possible to create a 3d extrusion of the tree using the following code:
linear_extrude(height = 5) { trunk(); }

Based on "Procedurally Generated Trees" by steveweber314 on instructables
http://www.instructables.com/id/Procedurally-Generated-Trees/

to use from with an OpenSCAD design:

use </path/to/this/file/fractal_tree.scad>

call with:
trunk();

paramaters:

size = [real] Base size for the trunk
depth = [integer 0:1] Number of recursions (warning: /exponentially more
opperations per increase of depth
seed = [real>0] Random seed to base tree on
widthBottom = [real 0:1] Width of bottom of each segment as a proportion of size
widthTop = [real 0:1] Width of top of each segment a s aproportion of size
joint = [real 0:1] Size of joint as percentage of size
minGrowth = [real 0.1:1.2] Minimum amount to grow branch as percentage of previous
maxGrowth = [real 0.1:1.2] Maximum amount to grow branch as precentage of previous
leafScale = [real 0.1:1] Radius of leaf as a percentage of branch size
leaf = [boolean true:false] True: include leaves, False: skip leaves