Giter Site home page Giter Site logo

strange-attractor-renderer's Introduction

Strange attractor renderer

A library and CLI to generate strange attractors.

Poisson saturne attractor

By default, this renders the poisson saturne attractor. This should be easy to change through coefficients (when using this as a library), and possibly in the binary (if I add the feature). This can however only render a subset of attractors, those of the polynomial Sprott type (see this page from chaoscope). Adding more should be relatively easy.

Features

All of these are optional.

  • PNG & BMP export
  • 16-bit
  • transparency
  • render depth texture
  • CLI
  • multithreaded
  • brightness control
  • shell completion

Installation

You need to have the latest version of stable Rust installed on your system. Clone this repo. Run cargo install --path . --profile production to install the binary to your user's path.

Documentation

Documentation of the main branch can be found at doc.icelk.dev.

To document with information on which cargo features enables the code, set the environment variable RUSTDOCFLAGS to --cfg docsrs (e.g. in Fish set -x RUSTDOCFLAGS "--cfg docsrs") and then run cargo +nightly doc.

Performance

This should be the fastest possible both in multithreaded and single-threaded mode. When running multithreaded, the main limiting factor is memory speed, not processing power (if you don't have a potato CPU, that is).

Animations

Using the sequence subcommand, you can generate a series of images. Then use the following command to encode it into a H.264 video. See it's --help flag for available options.

$ ffmpeg -i attractor%02d.png -vcodec libx264 -crf 17 -pix_fmt yuv420p out.mp4

You need to change the %02d part to the length of the frame index part of the outputted file name.

Acknowledgements

Many thanks to Björn von Sydow for the inspiration, initial code design, and continuing feedback.

Shell completion

Using the subcommand completion, the binary automatically generates shell completions for your shell and tries to put them in the appropriate location.

When using Bash or Zsh, you should run the binary as root, as we need root privileges to write to their completion directories. Alternatively, use the --print option to yourself write the completion file.

Images

These are generated using the following commands:

# Build binary
$ cargo build --release

# poisson-saturne.png
$ target/release/strange-attractor-renderer -i1000000000 -b -0.25
# solar-sail.png
$ target/release/strange-attractor-renderer -i1000000000 -h2000 -w1800 -b -0.1 -p solar-sail
# solar-sail-220deg.png:
$ target/release/strange-attractor-renderer -i1000000000 -h2000 -w1800 -p solar-sail -a 220

Poisson saturne attractor Solar sail attractor Solar sail attractor from -140°

License

This library and binary artefacts are licensed under the GNU LGPLv3.

strange-attractor-renderer's People

Contributors

dependabot[bot] avatar icelk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

strange-attractor-renderer's Issues

Compiling clap_autocomplete v0.3.0

Hello, when compiled it throws the following error:

Compiling clap_autocomplete v0.3.0
error[E0433]: failed to resolve: could not find BaseDirectories in xdg
--> C:\Users\Jusakito.cargo\registry\src\github.com-1ecc6299db9ec823\clap_autocomplete-0.3.0\src\lib.rs:125:29
|
125 | let dirs = xdg::BaseDirectories::new()?;
| ^^^^^^^^^^^^^^^ could not find BaseDirectories in xdg

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.