B4J Tutorial Discrete-Fourier-transform-visualization

It is a shortcut wrap for this Github project. Will convert it to B4J when I have some time to do so.

Attached:
1. The jar - copy it to your B4J additional libs folder
2. the B4J project - unzip it and then run it

How to use:
1. Click and hold down your mouse button and draw something (not visible) - let go of the mouse and it will draw your invisible drawing


2. Press 1, 2, 3, 4 on your keyboard and see how it draws the pics below






All with circles.....very interesting (me thinks)
 

Attachments

  • jFourier.jar
    165.8 KB · Views: 134
  • 1.png
    62.5 KB · Views: 160
  • 2.png
    78 KB · Views: 149
  • b4jFourier.zip
    394.9 KB · Views: 136
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
File from Assets are missing?

Files/calibrii.txt


edit: and others
Have updated the B4J project in Post #1.

Make sure that the /Object/Paths folder (and the file within this folder) is set to Read Only.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Converted the project to 100% B4J and using a Canvas to draw on (only drawing from pre-defined sampled images in the Files Tab of the IDE).
Beautiful to see the result of a few days of head banging - change it to your liking. The hard work has been done. Just amazing what a bunch of chained circles of different diameter and different rotation speeds can do!

You need to download the jCanvasExt library by @klaus (have attached it to this posting) - it has a method to draw Ovals with on a B4J canvas. Copy the jar and xml to your B4J additional library folder. No other "external" libs required other than for jCanvasExt

There are a number of *.txt files added to the Files tab of the IDE. Change the name to the file you would like to see being drawn. Search the web for similar text files and add them to your project.

*.txt Files for DFT epicycle drawings:
    '***************************************************************
    'SELECT ONE OF THE *.txt FILES FROM THE FILES TAB OF THE IDE
    '***************************************************************
    Dim filename As String = "ipimif.txt"

Just for interest sake - the below is drawn by using 1636 epicycles.




This dragon is drawn making use of 3937 epicycles:

 

Attachments

  • jCanvasExt.jar
    5.1 KB · Views: 106
  • jCanvasExt.xml
    35.5 KB · Views: 132
  • b4jFourierEmbed.zip
    92 KB · Views: 113
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Have added a class called "Arrow" (for the vectors) to the attached B4J project and 2 x check boxes so that one can switch on/off the circles and the vectors while it is drawing. Click on the check boxes to enable/disable the Circles and Vectors - on the run.

Class Arrow draws very simple directional arrows on the standard B4J canvas to show the direction of the various vectors used to draw the "picture" (in this case a "Dragon".

Change the file to be drawn in line 67 of the attached B4J project. The available files are all listed in the Files Tab of the B4J IDE.

Enjoy! It is an amazing project as far as what I am concerned ?

Circles displayed


Vectors displayed


Circles and Vectors displayed
 

Attachments

  • b4jFourierEmbed.zip
    375.8 KB · Views: 109
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…