GithubHelp home page GithubHelp logo

ahish9009 / epicycle-drawer Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 125.92 MB

Draws any input drawing or figure using epicycles, based on the concept of Fourier Transforms

License: MIT License

Jupyter Notebook 99.85% Python 0.15%
python fourier-analysis epicycle-drawing epicycles jupyter

epicycle-drawer's Introduction

Epicycle Drawer

epicycle-drawing

Introduction

This is a tool that takes in a drawing as input from the user and draws it using epicycles.

What are epicycles and epicycle drawings?

An epicycle is a circle, with a small radius, whose center revolves on the circumference of another circle of larger radius. The path traced by a point on the smaller circle can be manipulated to form various different shapes. This is demonstrated in the image below.

epicycle-gif
Multiple circles can be arranged and made to rotate at different speeds and in different phases. The path of a point on the last such circle can be traced, to create a drawing. The aim of this project is to take a desired drawing as input, and arrange circles in such a way that the path of a point on the last circle results in the desired drawing.

Example

Input

  • The input image is drawn into the drawing board
    drawing-input

Epicycle Drawing

  • Epicycles are generated to draw the input drawing
    epicycle-drawing

Plots

3D Plot of Various Angles of the Drawing

  • The transform output seen in 3D
    3d-epicycle

Output from Fourier Transform

plot-1

Scatterplot of Values from Fourier Transform

plot-2

Comparison of Original Sample Points & Points from Fourier Transform

plot-3

Usage

Clone this repo into a local directory.

It is recommended to run this project in a virtual environment, running Python 3(preferably Python 3.6). Install and create the environment using

  pip install virtualenv
  virtualenv -p python3.6 newvenv

Activate it using

  source newvenv/bin/activate

Install the necessary packages with

  pip install -r requirements.txt
  • Run the notebook with jupyter notebook
  • The settings cell can be changed as required.
  • You can either run the cells manually(use Shift+Enter to run a cell and move to the next one) or use the 'Run All Cells' option.
  • When the drawing board appears, draw your figure(preferably a continuous figure/shape, which while can be drawn with multiple strokes, should be possible to draw without lifting a pen). Continous figures ensure best results, however, the drawer works otherwise too(but is forced to add extra lines in regions where the pen would be lifted).
  • Close the drawing board window when you are done drawing and continue executing the following cells
  • To run the program again, use the Restart and Clear Output option.
NOTE

If the save_anim option is set to 1, then make sure to allow time for the animation to be saved, before running any other cells.

To-Do

  • Allow user to trace from a bg image(probably with some point assistance)
  • Generate epicycles for pre-existing image
    • Load image and get contours
    • Get sample points in order of appearance

Ideas & Software Used

  • Python
  • Fourier Transforms

Author(s)

Ahish Deshpande

epicycle-drawer's People

Contributors

ahish9009 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

basameera

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.