Giter VIP home page Giter VIP logo

fractal-rs's Introduction

fractal-rs

A Rust application (and library) for exploring a variety of fractals and to learn more about Rust.

Features include:

Some future ideas (in no particular order):

  • Option to automatically profile and adjust how much can be animated per-frame based on system performance for curves and chaos games.
  • Display information about the current fractal.
  • Greater interactivity, maybe a UI for choosing and configuring which fractal to display, or arrow keys to increment/decrement the iteration number.
  • Customizable color for some curves
  • Ability to export images or animations
  • Dynamically specify more parameters through configuration instead of compiling them in, or support some sort of configuration format for specifying parameters.
  • Other kinds of fractals like Julia/Fatou sets, etc.
  • Explore using threading and channels to construct a generic iterator of turtle program steps (simulating coroutines). This might allow for more programming styles within a TurtleProgram instead of having to create custom iterators for each TurtleProgram implementation that have to track state/program counter for the program. It would also be a great exercise in multi-threading.
  • Explore using a multi-threaded approach to render escape time fractals, which are highly parallelizable, and could also show the results in real time.

Usage

Fetch the git repository, and then use cargo to build it:

git clone https://github.com/aetherknight/fractal-rs.git
cd fractal-rs
cargo build

To run the application, you can use cargo run or call the binary directly (Eg, if you use cargo install to install the program). Resizing the window will dynamically resize the curve as well. You can exit by pressing the esc key.

To open a window and draw iteration 4 of the Cesàro square fractal:

cargo run -- cesaro 4

To animate the drawing of a curve, you can use the --animate option. You must specify the number of line segments that should be drawn per frame as well, such as 1 for one line per frame. The following will animate iteration 11 of the dragon fractal at a rate of 10 line segments per frame:

cargo run -- --animate 10 dragon 11

Exploring Fractals

TODO: Usage for all supported fractals

Note that for most fractals the iteration number results in an exponential increase in computation, so if you want to explore a higher iteration/generation of a curve, you may want to start with a low iteration number and increment your way up. (At the moment, the dragon fractal tends to take more than a few seconds to draw iterations above 15 my laptop when it draws the entire curve in a single frame).

At present, the other parameters that make up one of the curves --- such as the coordinate space, the L-system used to determine the drawing steps, or the angles chosen --- require changing the source code.

Contributing

  • If you have a feature request and would like to discuss it, please open a ticket.
  • If you would like to implement a feature, feel free to submit a pull request or open a ticket to discuss followed by a pull request.
  • If I receive many contributions, I will shift the project's copyright structure to reference a contributers file.

A few rules about contributed code:

  • In general, contributions should work on the current stable release of Rust. If you want to use a nightly Rust feature, we should discuss the approach (eg, can it be made optional, does it provide a huge performance improvement, etc.).
  • Use rustfmt to format your code before committing.
  • Write tests where it makes sense to do so (ie, test behaviors and functionality that could change as a side-effect of some other change), but do not fret about it.
  • Try to keep the use statements lexicographically sorted, with std and crate modules grouped together, and local modules grouped together after them.

License

Copyright (c) 2015-2016 William (B.J.) Snow Orvis. Licensed under the Apache License, Version 2.0. See LICENSE for details.

fractal-rs's People

Contributors

aetherknight avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.