forum

Single-Bezier Path Approximator

posted
Total Posts
26
Topic Starter
OliBomby
Summary
Approximate ANY path with a single Bezier curve using up to 15K anchors!
I used Tensorflow (machine learning library) to approximate paths with Bezier.


Usecases
- Converting any slider to Bezier (without red anchors)
- Increase/decrease the amount of anchors on a Bezier slider
- Generating Bezier sliders with an exact mathematical shape
- Making cursed sliders


Features
- Can turn any path into a single Bezier path
- Can input slidercode to convert into a single Bezier path
- Has a library of other mathematical shapes to use
- Retarded feature for retarded anchors that somehow make the desired path
- Easily expandable with some python knowledge


How to use it
1. Download and install all the requirements
2. Download this program from the github and unpack the contents into a folder
3. Paste the slidercode from the .osu into input.txt
4. Open slider_approximator.py
5. Input all the arguments (number of anchors~(2-10K), steps~(5K-20K), test resolution~(1K-5K), retardedness~(0-5000))
6. Wait a little and see the Bezier anchors move around
7. Find your new slider code in slidercode.txt

Advanced
1. Open shapes.py and shape_approximator.py with some text editor
2. At the bottom of shape_approximator.py you can find some code showing off how to import a path and use that in the approximator
3. Import any path from shapes.py and make sliders out of it
4. Code your own mathematical shapes and make sliders out of those
Files Explanation
- shape_approximator: has the code that does all the Bezier approximation and other stuff
- slider_approximator: user-friendly dialog to use the program using slidercodes
- path_approximator: generates the bezier, catmull, circular arc and liniar paths
- slider_path: calculates slider stuff
- shapes: contains generators for mathematical shapes
- gosper: generates gosper curve fractals
- structs: has some random math

Requirements
These are the versions on my computer at the time. Later versions may work too.
- Python 3.5.2 64-bit
and the following modules:
- numpy 1.14.5
- tensorflow 1.10.0 (or tensorflow-gpu)
- matplotlib 2.1.0
- scipy 1.0.0
help


Download
https://github.com/OliBomby/Bezier-Approximation


Known problems
- Sharp angles can be inconsistently cut off by a few pixels due to how bezier curves only get rendered every 6 pixels
- I used the word 'shape' as if it meant 'path'


Special thanks to Karoo because without him I would have never started on this program
ScubDomino
hwat the uck
iljaaz
oh god
DeviousPanda
im scared now
Ayesha Altugle
with this, red anchors are now rendered obsolete
CrazyrabbitKGE
gang
emu1337
:weary:
Dereban
thanks now i can make good sliders
Potoofu
death of the red anchor
Karoo13
Im disappointed in you son
Reywateil
this is cursed
Octoling
wow, thank you for this revolutionizing mapping tool. we are now be free from red anchors' opression.
Aiseca
This is cursed.
enenbon
blessed post
Rynnavinx
the future of mapping is now
Trappy-kun
How to aspire 2019
mindmaster107
At on the 3rd day, Oli said...

Let there be light!

The slider exploded with white nodes, shining bright out into the universe, filling it with galaxies and cosmological intrigue and variety.
BTMC
Machine Learning applied to osu!
THIS IS THE FUTURE.
Delta Vee
Thank you, now I have access to the behind-the-scenes sliders previously posted
volume
Too bad it isn’t all red anchors 4head
TheBlank
Jesus
facespkz
it looks like a mapper had a seizure and spammed anchors everywhere but still managed to do slider art
Topic Starter
OliBomby
Redownload after 5-5-2019 for some major bug fixes
Creamy Candy
cursed
ebolite
now do it with catmull
Akeruyri
>Retardedness
Please sign in to reply.

New reply