Skip to content

YuriNikolai/Lsystemexport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Simple L-system exporter

Note that this project still has a lot of room for improvements, but the basic export functionality is already working.

This is a modification of the simple L-system "tree" generator by Daniel Shiffman: https://github.com/CodingTrain/website/blob/main/CodingChallenges/CC_016_LSystem/Processing/CC_016_LSystem/CC_016_LSystem.pde

I added the option to export your generated L-system as a .png with transparent background. Feel free to use these images for whatever purpose you want to. This code is placed under the GPL 3.0 license. Images generated by this code in its current state, without any further editing on an external application, are probably impossible to copyright due to them not passing the minimum originality requirement, as they are the product of an incredibly simple formal grammar that cannot be copyrighted.

Keep in mind this program's exports have single-pixel line strokes, so they may look weird on your screen if you are using a default Windows media viewer. Open them with an image editor like paint.NET or Aseprite and zoom in to see them in their full detail.

Controls

Right click to generate a new iteration. The code limits you to 6 iterations, but this limit can easily be changed at the top of the code (though further iterations can take quite a lot of time to render, or break the appearance of your tree completely depending on the ANGLEDEG constant).

Spacebar to save. Your images will appear in the same folder as the .pde file. Keep in mind the .pde needs to be in a folder with the same name as itself in order to work.

I have uploaded a small sample of outputs, in case you want to see some of this tool's results without needing to run it: https://opengameart.org/content/l-system-procedurally-generated-trees

Further reading:

About

A simple L-system "tree" generator, modded to allow exporting the output as PNG images with transparent background.

Topics

Resources

License

Stars

Watchers

Forks