GithubHelp home page GithubHelp logo

quasicrystals's People

Contributors

pauloday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

risingbirdsong

quasicrystals's Issues

Add animation output

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.

Add new colorization methods

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.

Rewrite README

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.

Add over time change to params

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?

Command line interface

There needs to be a good commandline interface, so I can pick

  • Colorization options
  • Resolution
  • Scale
  • Order

I have a need for speed!

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:

  • memoize sin/cos/asin
    This is probably just a worse version of using a lookup table
  • use a lookup table for sin/cos/asin
    I only need accuracy to the thousandths on sin/cos. Specifically, I need 255 values from 0 to 1, distributed with sin/cos/asin.
  • Utilize concurrency
    Each pixel and frame is independent, so it should be pretty easy to parallelize. But the code will need to be restructured a bit to use pmap or agents.

Overall I'm going to try memozing since it's trivial, then a lookup table and compare. The concurrency can wait.

Unit and benchmark tests

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.

Split up codebase

This is related to #10, but the code should be split up

  • main.rs: handle command line arguments and file i/o
  • crystal.rs: generate the images
  • color.rs: colorize the crystals

Rewrite in Rust

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.

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.