pauloday / quasicrystals Goto Github PK
View Code? Open in Web Editor NEWA program to animate quasicrystals on a 2d plane
A program to animate quasicrystals on a 2d plane
For the Rust rewrite, I need to have good unit tests, and good benchmark tests.
The benchmark tests are most important, #2 needs to be done so I can script them.
gstreamer-rs seems like the best option
Idea comes from astronomy color mapping. To implement it here we'd take a list of shade ranges and assign each color to that range. For example, 0-0.3,0.3-0.6,0.6-1 would map red 0-255 to the shades 0-0.3, etc. The ranges could also overlap.
The method would be called 'composite' and the default values would be 0-0.4,0.3-0.7,0.6-1
Add a way to animate the phase of each layer like the angle and composite colorization. This would be a string passed into the speed option (which should be renamed) for one or more layers. One animation string passed in will affect all layers, more than one will affect the layers in order they're specified in the angles argument. If there are fewer phase animations than layers the rest of the layers will have no animation.
Have this output gifs or videos directly. For gifs rust-image has support, but for videos I'm probably going to have to use some kind of ffmpeg interface.
This will be the same as the angle animation, ':' separated ranges. Maybe add it to sawtooth, not sure if that makes sense. If not probably just take sawtooth out as it's kind of weird and the only reason for it to exist is a way to animate the color changes.
This is kind of reliant/part of #2, but there's a blog article this was based on, I should add that. Also add some examples, I've got some really cool colorizations now.
Right now the errors when parsing are either nonexistant (you just get bad frames), or not good (you get rust error messages with line numbers). Improve this by handling errors with helpful messages
Now that the animation parser is generic, all the things can be animated.
This is related to #10, but the code should be split up
Some of the params could change over time. I'm thinking the initial batch will be scale, x/y offset and order. Order might look weird but I think that's fine. I wish there was a way to do fractions of an order. Maybe adjusting the angle from being evenly spaced over the course of the animation?
Right now the colorizor is generated separately from the frame data. This is an artifact of when the colorizor wasn't animated, but now it is so keeping it separate doesn't make sense.
The command line args are getting complex and it's a not great that the config for each layer is split up. Add a way to read a config where each line represents a layer's angle, color, and phase animations.
Use multithreading to speed it up!
After some thought, I've come to the conclusion that it'll probably be more trouble than it's worth. The expressive power of Clojure is nice but doesn't bring much to the table here, since the program is basically just "do math -> place pixel". There is a lot of stuff that makes that process slower though.
I think I could make this a lot more efficient in Clojure, but ultimately I think my effort would be better spent looking at a lower level (i.e. faster) language. Rust is one I've heard great things about, both speed and design wise, so I've wanted to learn it for a while. This project is relatively simple, but it does have some complexity, and it's got plenty of room to really learn about Rust and the features that make it so great.
So yeah, this codebase is moving to Rust.
There needs to be a good commandline interface, so I can pick
This thing is real slow. It does a bunch of different sin/cos/asin operations for each pixel of each frame. Speed it up!
Possible optimziations:
Overall I'm going to try memozing since it's trivial, then a lookup table and compare. The concurrency can wait.
There are some more ways to colorize it I could investigate. Right now it uses a sawtooth wave, I could look at other waveforms. Or I could adjust the phase spacing to make the colors different as well.
At least have them be consts inside the code, ideally there'd be a config file or something
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.