Skip to content

demr64/LFractals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

LFractals - L-Systems

My Image

This mini-project is about the implementation of different L-Systems which can generate different fractal structures such as the sierpinski triangle. I made it with Python and the turtle library. The main resources I used for learning were:

An L-system is defined by: V: the alphabet, a set of symbols that contains variables and constants W: the axiom, it defines the initial state of the system, it's a string P: which defines the rules and ways that we can transfrom symbols.

So we will formalize this in classes, which will contain fundamental information about the fractal object, such as the actions that have to be taken when a symbol is fond or the axiom. As an example, values from the SierpinskiRules class would be:

    axiom = "A"
    constants = ["+", "-"]
    angle = 60
    mov_value = 3
    rules = {
        "A": "B-A-B",
        "B": "A+B+A",
    }
    actions = {
        "A":["FORW"],
        "B":["FORW"],
        "+":["ROTL"],
        "-":["ROTR"],
    }

The particular curves available are:

  1. Sierpinski's triangle
  2. Dragon curve
  3. Koch curve
  4. Hilbert curve
  5. Koch snowflake

About

Fractal generation using Lyndenmayer systems

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages