Git Product home page Git Product logo

qfract's Introduction

qfract

qfract is small library that calculates mandelbrot set and some useful properties (like surface normal) for coloring. It is written in Rust with bindings for python. The motivation for qfract was to learn Rust and because of my fascination with fractal coloring and due to extreme slowness of python implementation.

Install instructions

from source

Install rust compiler from https://www.rust-lang.org/tools/install

then just clone and install package with python>=3.7

git clone ...
pip install setuptools_rust
python setup.py install

Features

At this moment there are 3 algorithms that more or less does the same but with slightly different result. Output of these algorithms is:

  • Smooth iteration count
  • Stripe Average
  • Normal to surface
  • Lambertian shading
  • Distance

As far as calculation is concerned:

  • Multi-core calculation with Rusts's Rayon
  • Numpy output

Examples

Examples include zooming, calculation of isolated mandelbrot set,simple explorer, animated lighting

To run most of the examples (animated), it is required to install opencv

Run examples

python examples/*

Sources

I heavily relied on these sources

Great source on beautiful mandelbrot coloring and stripe average coloring. Unfortunately very slow without GPU

  1. https://github.com/jlesuffleur/gpu_mandelbrot/blob/master/mandelbrot.py

Calculation of lambertian shading, Optimization without complex numbers

  1. https://www.fractalforums.com/general-discussion/stripe-average-coloring/

  2. https://www.math.univ-toulouse.fr/~cheritat/wiki-draw/index.php/Mandelbrot_set

Unfortunately I could not get the main source of above mentioned sources, which is Masters Thesis On Smooth Fractal Coloring Techniques by Jussi Harkonen. Therefore I had to rely on these indirect sources.

TODO

  • Optimize
    • Vec iteration is very slow
    • Add calculation options (choose what properties to calculate)
    • GPU
  • Add new algorithms
    • Julia set
    • Add standard mandelbort (Now only smooth iteration count)
  • General refactor
    • Clean up on both sides - Rust and Python

qfract's People

Contributors

marfay avatar moyogatomi avatar

Watchers

 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.