Skip to content

Farbfetzen/epicycles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drawing shapes with epicycles

This app lets you draw any 2d shape using a combination of circles with different radii and rotation speeds. For more info see this Video by The Coding Train or this Video by Mathologer.

heart
closed hilbert curve

Requires Python >= 3.6, PyGame 2 and NumPy.

To run the app you can provide a path to a text file containing the points of the desired shape:

python epicycles.py shapes/heart.txt

If you run it without a file path then the app will go into "draw" mode. There you you can draw a shape with the mouse. Then hit enter to watch the circles go.

Controls

Action Binding
Pause/unpause Space
Erase the line Backspace
Toggle line fading F
Toggle visibility of the circles C
Increase speed +
Decrease speed -
Reverse rotation R
Switch between the circles and the drawing mode Enter
Toggle debug mode F1
Quit Esc

Optional Command Line Arguments

  • -h, --help: Show a help message and exit.
  • -n <int>: Limit the maximum number of circles.
  • -s, --scale <float>: A number > 0 and <= 1 indicating how much of the width and height of the window the shape should occupy. To disable scaling set it to 0.
  • -f, --fade: Fade the line color over time so that it vanishes after one cycle.
  • -r, --reverse: Reverse the rotation direction.
  • -p, --paused: Start the app paused.
  • -w, --window-size <width> <height>: Specify a custom window width and height in pixels.
  • -d, --debug: Start the app in debug mode.

About

Like a spirograph but more awesome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published