Skip to main content

Frascii

ASCII-visualizations of Fractals for the Ubuntu (or other) Terminal

Install using pip install frascii

Commands

frascii sierpinski_carpet <n>: Displays the n-th iteration of the Sierpinski Carpet.

frascii sierpinski_triangle <n>: Displays the n-th iteration of the Sierpinski Triangle.

frascii cantor <n>: Displays the n-th iteration of the Cantor Set.

frascii koch <n>: Displays the n-th iteration of the Koch Snowflake.

frascii vicsek <n>: Displays the n-th iteration of the Vicsek Fractal.

frascii hilbert_curve <n>: Displays the n-th iteration of the Hilbert Curve.

frascii peano_curve <n>: Displays the n-th iteration of the Peano Curve.

frascii dragon_curve <n>: Displays the n-th iteration of the Dragon Curve.

frascii fibonacci <n>: Displays the Fibonacci Sequence up to n as squares.

frascii mandelbrot <x, y, x_radius, y_radius, stepsize, max_iter, grid, style, explore>: Displays a specified part of the Mandelbrot Set.

frascii julia <f, x, y, x_radius, y_radius, stepsize, max_iter, grid, style, explore>: Displays a specified part of the Julia Set for a given f(z).

frascii l_system <start, rules, n, animate>: Displays a curve generated by a L-System. Angles will be fixed to 90°.

more to come ...

Examples

Mandelbrot set

frascii mandelbrot -x_radius 400 -y_radius 180 -stepsize 0.0033 -style non-repeating

Mandelbrot set in terminal by frascii

frascii mandelbrot -x_radius 400 -y_radius 180 -stepsize 0.0033 -style repeating

Mandelbrot set in terminal by frascii

frascii mandelbrot -x_radius 300 -y_radius 300 -explore

Mandelbrot set in terminal by frascii

frascii mandelbrot -x -1.15 -y 0.26 -x_radius 200 -y_radius 70 -stepsize 3.7e-4 -max_iter 60

Mandelbrot set in terminal by frascii

frascii mandelbrot

                                                       
                                       ▓░              
                                      ░░▒░▒█           
                                     ░░░██▒░░          
                                  ░░░░▒████▓░░         
                              ░░░░░░░░▒████▒░░░░░░▓    
                            ░░░▒██▓███████████▓▒▒▒▓▒   
                          ░░░░▒▒██████████████████▓░░  
                 ░▒░░░░░░░░░░▒▓███████████████████▓░▓  
                ░░░▓▓▒▒█▒▒░░▒██████████████████████▒░░ 
               ░░░▒▓███████▒▓███████████████████████░  
         ░░░░░░▒▒▒█████████████████████████████████░░  
    █████████████████████████████████████████████▒░░░  
         ░░░░░░▒▒▒█████████████████████████████████░░  
               ░░░▒▓███████▒▓███████████████████████░  
                ░░░▓▓▒▒█▒▒░░▒██████████████████████▒░░ 
                 ░▒░░░░░░░░░░▒▓███████████████████▓░▓  
                          ░░░░▒▒██████████████████▓░░  
                            ░░░▒██▓███████████▓▒▒▒▓▒   
                              ░░░░░░░░▒████▒░░░░░░▓    
                                  ░░░░▒████▓░░         
                                     ░░░██▒░░          
                                      ░░▒░▒█           
                                       ▓░              

Julia set

frascii julia -f "z**2 - 0.4 + 0.6j" -x_radius 450 -y_radius 180 -stepsize 0.0033

Julia set in terminal by frascii

frascii julia -f "z**2 - 0.8" -x_radius 500 -y_radius 150 -stepsize 0.0033 -max_iter 20

Julia set in terminal by frascii

frascii julia -f "2-z**2" -max_iter 5 -stepsize 0.008 -x 1 -x_radius 375 -y_radius 25

Julia set in terminal by frascii

Hilbert Curve

frascii hilbert_curve -n 4

Hilbert curve in terminal by frascii

frascii hilbert_curve -n 3

┌─┐ ┌─┐ ┌─┐ ┌─┐
│ └─┘ │ │ └─┘ │
└─┐ ┌─┘ └─┐ ┌─┘
┌─┘ └─────┘ └─┐
│ ┌───┐ ┌───┐ │
└─┘ ┌─┘ └─┐ └─┘
┌─┐ └─┐ ┌─┘ ┌─┐
│ └───┘ └───┘ │

Dragon Curve

frascii dragon_curve -n 9

                    ┌─┐     ┌─┐                                 
                    └─┼─┐   └─┼─┐                               
                ┌─┐ ┌─┼─┼─┐ ┌─┼─┘                               
                └─┼─┼─┼─┼─┼─┼─┼─┐                   ┌─┐ ┌─┐     
                ┌─┼─┘ └─┼─┼─┼─┼─┘   ┌─┐           ┌─┘ └─┼─┘     
                └─┼─┐   └─┼─┼─┼─┐   └─┼─┐         └─    └─┐ ┌─┐ 
                  └─┘   ┌─┼─┼─┼─┼─┐ ┌─┼─┘               ┌─┼─┼─┘ 
                        └─┼─┼─┼─┼─┼─┼─┼─┐               └─┼─┘   
    ┌─┐     ┌─┐     ┌─┐ ┌─┼─┼─┼─┼─┼─┼─┼─┘   ┌─┐     ┌─┐ ┌─┘     
    └─┼─┐   └─┼─┐   └─┼─┼─┼─┼─┼─┼─┼─┼─┼─┐   └─┼─┐   └─┼─┼─┐ ┌─┐ 
┌─┐ ┌─┼─┼─┐ ┌─┼─┼─┐ ┌─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┐ ┌─┼─┼─┐ ┌─┼─┼─┼─┼─┘ 
└─┼─┼─┼─┼─┼─┼─┼─┼─┼─┘ └─┘ └─┼─┼─┼─┼─┘ └─┘ └─┼─┼─┼─┼─┘ └─┘ └─┘   
┌─┼─┘ └─┼─┼─┼─┼─┼─┘       ┌─┼─┼─┼─┘       ┌─┼─┼─┼─┘             
└─┼─┐   └─┼─┼─┼─┼─┐ ┌─┐   └─┘ └─┼─┐ ┌─┐   └─┘ └─┼─┐ ┌─┐         
  └─┘   ┌─┼─┼─┼─┼─┼─┼─┘       ┌─┼─┼─┼─┘       ┌─┼─┼─┼─┘         
        └─┼─┘ └─┘ └─┘         └─┘ └─┘         └─┘ └─┘           
    ┌─┐ ┌─┘                                                     
    └─┼─┼─┐ ┌─┐                                                 
┌─┐ ┌─┼─┼─┼─┼─┘                                                 
└─┼─┼─┼─┼─┼─┘                                                   
┌─┼─┘ └─┼─┘         ┌─┐                                         
└─┼─┐   └─┐ ┌─┐     ╵ └─┐                                       
  └─┘   ┌─┼─┼─┘       ┌─┘                                       
        └─┼─┼─┐ ┌─┐ ┌─┼─┐                                       
        ┌─┼─┘ └─┼─┼─┘ └─┘                                       
        └─┼─┐   └─┼─┐                                           
          └─┘     └─┘                                           

L-systems

Rules

F will step forward and draw a line.

f will step forward and not draw a line.

+ will turn right.

- will turn left.

[ will put current position and orientation on the stack.

] will set current position and orientation based on topmost entry on stack which is then removed.

Any other character can be used in the rules but will be ignored when drawing.

frascii l_system -start "F" -rules "(F->F+F-F-F+F)" -n 2 -direction R

          ┌─┐           
        ┌─┘ └─┐         
      ┌─┘     └─┐       
    ┌─┼─┐     ┌─┼─┐     
  ╶─┘ └─┘     └─┘ └─╴   

frascii l_system -start "F+F+F+F" -rules "(F->F+F-F-FF+F+F-F)" -n 2 -direction U leads to a Koch Island.

                      ┌─┐                                 
                    ┌─┘ │ ┌─┐                             
                    └─┐ └─┘ └─┐                           
                  ┌───┘   ┌───┘                           
              ┌─┐ └─┐     └─┐         ┌─┐                 
            ┌─┘ │ ┌─┘       │       ┌─┘ │ ┌─┐             
            └─┐ └─┘         └─┐     └─┐ └─┘ └─┐           
          ┌───┘           ┌───┘   ┌───┘   ┌───┘           
          └─┐ ┌─┐         └─┐ ┌─┐ └─┐     └─┐ ┌─┐         
            └─┘ │ ┌─┐       └─┘ │ ┌─┘       └─┘ │ ┌─┐     
                └─┘ └─┐         └─┘             └─┘ └─┐   
                  ┌───┘                           ┌───┘   
      ┌─┐     ┌─┐ └─┐                 ┌─┐     ┌─┐ └─┐     
    ┌─┘ │ ┌───┘ │ ┌─┘               ┌─┘ │ ┌───┘ │ ┌─┘     
    └─┐ └─┘     └─┘                 └─┐ └─┘     └─┘       
  ┌───┘                           ┌───┘                   
  └─┐ ┌─┐             ┌─┐         └─┐ ┌─┐                 
    └─┘ │ ┌─┐       ┌─┘ │ ┌─┐       └─┘ │ ┌─┐             
        └─┘ └─┐     └─┐ └─┘ └─┐         └─┘ └─┐           
          ┌───┘   ┌───┘   ┌───┘           ┌───┘           
          └─┐ ┌─┐ └─┐     └─┐         ┌─┐ └─┐             
            └─┘ │ ┌─┘       │       ┌─┘ │ ┌─┘             
                └─┘         └─┐     └─┐ └─┘               
                          ┌───┘   ┌───┘                   
                          └─┐ ┌─┐ └─┐                     
                            └─┘ │ ┌─┘                     
                                └─┘                       

frascii l_system -start "A" -rules "(A->+BF-AFA-FB+),(B->-AF+BFB+FA-)" -n 4 -direction R leads to a Hilbert Curve.

frascii l_system -start "A" -rules "(A->+BF-AFA-FB+),(B->-AF+BFB+FA-)" -n 4 -direction R -animate

Hilbert curve in terminal by frascii

frascii l_system -start "FX" -rules "(X->X+YF+),(Y->-FX-Y)" -n 10 -direction U leads to a Dragon Curve.

frascii l_system -start Y -rules "(Y->YZ-Z-Z-ZA--),(X->XZ),(Z->XF),(A->Z)" -n 6 leads to Fibonacci Squares.

This L-System manual by Paul Bourke shows much more L-system definitions for cool patterns.

Tip for better visualization

Make a new custom terminal profile and set its fontsize to 1 (Menu->Preferences->Profiles). Then you can switch between the default profile and the new one to have "more pixels" on one page.

Metadata

Release files for frascii 3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for frascii 3.7
File Size Uploaded
frascii-3.7.tar.gz 14.1 kB Details

Release files / frascii-3.7.tar.gz

Download URL frascii-3.7.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
54a77763865dc0db9a9764a5a31e07eb57d9133249569727271728a1f5984694
BLAKE2b-256 checksum
How to use checksums
4a3f8fdc7c3fa49287be57806ac9d51c077ffc997f67725f03aa3c897dde6d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

3.7 This release

1 release file

3.6

1 release file

3.5

1 release file

3.4

1 release file

3.3

1 release file

3.2

1 release file

3.1

1 release file

3.0

1 release file

2.9

1 release file

2.8

1 release file

2.7

1 release file

2.6

1 release file

2.5

1 release file

2.4

1 release file

2.3

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page