Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

roryclaasen/fractal-tree

Repository files navigation

Fractal Tree

roryclaasen.github.io/fractal-tree

p5 visualisation of a Fractal Tree.

Contents

Examples

Example Example Example Example

Options

Tree.Length

Type Default Min Max
Number 200 0 500

The length of the starting branch

Tree.Max_Branches

Type Default Min Max
Number 10 1 20

How many steps of branches are there

Tree.Angle

Type Default Min Max
Number 0.7 -PI PI

The angle of each child branch

Tree.Branch_Multiplier

Type Default Min Max
Number 0.6 0.1 2

Child branch length multiplier based of parent branch

Tree.Reset

Type
Button

Resets all Tree options to default values

Mutate.Active

Type Default
Boolean false

If the tree will get mutated or not

Mutate.Branch

Type Default Min Max
Number 2 0 2

Percentage chance of the child Branches being created

Mutate.Angle

Type Default Min Max
Number 0 0 PI

Intensity of angle interference

Example

tree.angle += Math.random() * mutate.angle;

Mutate.Branch_Multiplier

Type Default Min Max
Number 0 0 1

Intensity of angle interference

Example

tree.branchMultiplier += ((Math.random() * 2) - 1) * mutate.branchMultiplier;

Mutate.Make

Type
Button

Regenerates the tree with new values

Mutate.Reset

Type
Button

Resets all Mutate options to default values

Transform.X_Offset

Type Default Min Max
Number 0 -width width

Translate the Tree on the X axis

Transform.Y_Offset

Type Default Min Max
Number 0 -height height

Translate the Tree on the Y axis

Transform.Scale

Type Default Min Max
Number 1 0 5

Scale the Tree

Transform.Rotate

Type Default Min Max
Number 0 -PI PI

Rotate the Tree around the root of the tree

Transform.Center

Type
Button

Button to set the offsets centrally on the screen

Transform.Reset

Type
Button

Resets all Transform options to default values

Appearance.Saturation

Type Default Min Max
Number 360 0 360

The saturation of the branch color

For white colored branches set this to 0

Appearance.Brightness

Type Default Min Max
Number 360 0 360

The brightness of the branch color

Appearance.Gradient

Type Default
Boolean false

Branches colors will blend from one branch to the next

Appearance.Weight

Type Default Min Max
Number 1 1 15

Stroke Weight of the lines being drawn

Appearance.Background

Type Default
Color #000000

Background color of the window

Appearance.Leaves

Type Default
Boolean true

Shows white dots on the ends of all the end branches

Appearance.Mirror

Type Default Options
String off 'off', 'y', 'x y'

Mirrors the Tree on other axis. Start point remains the same

Appearance.Reset

Type
Button

Resets all Appearance options to default values

Save

Type
Button

Saves the current drawing as a PNG file

Branches

Branch Travis CI Server
Master Build Status GitHub Pages

License

This project is licensed under the MIT License - see the license file for details