Skip to content

wcygan/turtle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle

A Generative Art tool in Rust!

This was inspired by Isaacg1's Programatically Generated Artwork .

Build & Run

Installation via cargo

Make sure you have Rust and Cargo installed.

Install this project on any platform using Cargo:

$ cargo install --git https://github.com/wcygan/turtle

How to run

$ turtle -s <size> -n <name> -p <pattern>

Options

The program options that can be used:

Option Usage Example
-s Number of pixels, N, to create an N x N image -s 10
-r Seed used to initialize a pseudorandom number generator -r 1234
-n Name of the output file -n foo
-p Image pattern to use -p square
-x Imaginary part of a complex number -x -0.55
-y Real part of a complex number -y 0.53
-i Number of times to executed iterated algorithms -i 105

Output Examples

Mandelbrot Set

$ turtle -n mandelbrot-fractal -p mandelbrot-fractal -s 8000 -x -0.5 -y 0.5 -i 104

Julia Set

$ turtle -n julia-fractal -p julia-fractal -s 3000 -x -0.55 -y 0.53 -i 105

Squiggly

$ turtle --pattern squiggly --name bar --size 1500

Julia Weird

$ turtle -n julia-weird -p julia-weird -s 8000 -x -0.596 -y 0.555 -i 60

Blobs

$ turtle --name blobs --pattern blobs --rng 14415323423445943 --size 3000

Airbrush

$ turtle --pattern airbrush --name airbrush --size 2000

Tree

$ turtle --size 2000 --pattern tree --rng 12 --name tree

Diamond

$ turtle --size 1000 --name diamond --pattern diamond --rng 124331

Snowflake

$ turtle --size 1000 --name snowflake --pattern snowflake --rng 12494213

Pixels

$ turtle --name pixels --size 2000 --pattern pixels

Square

$ turtle --size 350 --name square --pattern square --rng 2121

Circle

$ turtle --size 350 --name circle --pattern circle --radius 99479

Dependencies

  • clap to parse commands
  • image to create images
  • rand to generate pseudorandom numbers
  • rayon to parallelize execution
  • num-complex for complex math'

Directory Tree

$ tree
.
├── Cargo.lock
├── Cargo.toml
├── examples
│   ├── airbrush.png
│   ├── blobs.png
│   ├── circle.png
│   ├── diamond.png
│   ├── julia-fractal.png
│   ├── julia-weird.png
│   ├── mandelbrot-fractal.png
│   ├── pixels.png
│   ├── snowflake.png
│   ├── square.png
│   ├── squiggly.png
│   └── tree.png
├── readme.md
└── src
    ├── algorithms
    │   ├── airbrush.rs
    │   ├── blobs.rs
    │   ├── circle.rs
    │   ├── diamond.rs
    │   ├── julia_fractal.rs
    │   ├── mandelbrot_fractal.rs
    │   ├── mod.rs
    │   ├── pixels.rs
    │   ├── snowflake.rs
    │   ├── square.rs
    │   ├── squiggly.rs
    │   └── tree.rs
    ├── arguments.rs
    ├── dispatcher.rs
    └── main.rs