Use fourier transform to draw epicycles with your drawings.
Draw a picture or sample one, press space, then watch an epic simulation of epicycles being drawned identically as your picture. Thanks the the fourier transform your drawing will be reproduced in a real-time simulation only using epicycles.
Demo
Install
#Clone the repository
git clone https://github.com/MarcPartensky/Fourier.git
cd Fourier
#Install requirements
pip install -r requirements.txt
Usage
Put your model image image.png in the FourierImages folder.
- Option 1: Give image at launch.
python __main__.py image.png
- Option 2: Launch then give the image.
python __main__.py
> image name:
Then give your image:
> image name:image.png
Run with docker
# Download the docker-compose.yml file and cd into its parent folder
# Put your image in the FourierImages folder then run
# Replace 'image.png' by your own image filename
docker-compose run --rm fourier image.png
Or choose your own folder
# Download the docker-compose.yml file and cd into its parent folder
# Replace the first occurence of 'FourierImages' by your custom image folder
# Replace 'image.png' by your own image too
docker-compose run --rm \
-v ./FourierImages:/opt/FourierImages \
fourier image.png
Or run the full docker command without the docker-compose.yml file
docker run --rm \
-v $PWD/image.jpg:./image.jpg \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--device /dev/dri \
-e DISPLAY \
marcpartensky/fourier /image.jpg
Or store the coefficients and the images in a folder
docker run --rm \
-v $PWD/FourierImages:/opt/FourierImages \
-v $PWD/FourierObjects:/opt/FourierObjects \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--device /dev/dri \
-e DISPLAY \
marcpartensky/fourier image.jpg
Description
There are 3 modes in this program:
-
Mode 1: Sampling Sample or draw a picture.
-
Mode 2: Drawing Watch the epicycles simulation which uses fourier transform.
-
Mode 3: Display Get the output image directly without waiting for the simulation.
Controls
Space: Switch to next mode.Enter: Go back to the center.Up/Down/Right/Left Arrow: Move arround.Right/Left Shift: Zoom in or out.Quit/Escape: Quit.Z: Cancel last sample.R: Remove all samples.S: Save the fourier-coefficients.
Hide or Show the graphical components
Press the following numbers to toggle:
1: Image2: Green lines3: Red graph4: White vectors5: Grey circles6: Yellow sample
Enjoy!
Release files for fourier-drawing 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fourier_drawing-0.1.8.tar.gz | 54.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fourier_drawing-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 113.2 kB
Release files / fourier_drawing-0.1.8.tar.gz
| Download URL | fourier_drawing-0.1.8.tar.gz |
|---|---|
| Size | 54.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b1acbcfdaf7c9b7590d64ff6f18da1d2785da6a23874017e6c932c392cbb77c
|
|
BLAKE2b-256 checksum How to use checksums |
cb5bd54f8dbb5d91ab72328a26f55556ef66984e3796caa0f517547f73532545
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.9 Linux/5.15.93-1-lts
|
Release files / fourier_drawing-0.1.8-py3-none-any.whl
| Download URL | fourier_drawing-0.1.8-py3-none-any.whl |
|---|---|
| Size | 58.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6294f062c12013e690043eda09ef586fd4660c41d8e6330e0e0fd41fc2d42b40
|
|
BLAKE2b-256 checksum How to use checksums |
7be911fda82527137bf3e948e361d50690b23e1b664b2be314e46555441252e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.9 Linux/5.15.93-1-lts
|