项目作者: wephy

项目描述 :
An interactive fractal explorer built with pygame, numpy and numba - utilising cuda processing and customisable color-mapping.
高级语言: Python
项目地址: git://github.com/wephy/fractal-explorer.git
创建时间: 2021-04-05T17:48:14Z
项目社区:https://github.com/wephy/fractal-explorer

开源协议:MIT License

下载


mandelbrot

Interactive Fractal Explorer [fractal-explorer]

An interactive fractal explorer built with pygame, numpy and numba - utilising cuda processing and customisable color-mapping.

Version 1.1.0

Features

Executing

The program can either be run by command-line execution or within an IDE. I recommend using this within an anaconda environment with the cudatoolkit package (version 10.2.89) installed for the most seamless use.

Command-line execution:

run py fractal.py

optional arguments:

  • -h, —help
    show help message and exit
  • -f
    fractal set to generate from {‘burningship’, ‘mandelbrot’}
  • -i
    maximum iterations
  • -c
    starting coordinates xmin, xmax, ymin, ymax separated by spaces. e.g. py fractal.py -c -2.5 1.5 -2.0 2.0
  • -r
    resolution of window

Example:
py fractal.py -r 1280 -f burningship -c -1.8 -1.7 -0.01 0.09

Within an IDE:

run main() within fractal.py

All parameters are optional. The defaults are:
fractal='mandelbrot'
iterations=1500
resolution=1000
coords=(-2.5, 1.5, 2.0, 2.0)

Here is an example of executing with custom parameters:

  1. main(fractal='burningship',
  2. iterations=2500,
  3. resolution=720,
  4. coords=(-1.8, -1.7, -0.01, 0.09))

Controls

(All controls take place on cursor position)
  • Left-click: zoom in
  • Right-click: zoom out
  • Middle-mouse: relocate center

Requirements

Python 3.8 or later

For module requirements see requirements.txt

NOTE: Testing has only been with Python 3.8+

To-do

  • Add more fractal sets
  • Add smooth zoom animation
  • Add regular jit and/or cuda emulation fallback for cuda incompatible systems
  • Add menu screen (for entering fractal, resolution, colormap, max iterations, etc.) => turn into executable
  • Add additional controls (e.g. return to original position)
  • Add the option to select colourmap in command line execution