qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

Extract point generation #56

Closed enzuguri closed 8 years ago

enzuguri commented 8 years ago

Enables specifying a custom array of points (see the custom-points-example.html) for users who may want to provide their own point generation.

Additionally, I refactored the code required to generate points to inline the _map function for performance reasons, this jsbin highlights the difference: http://jsbin.com/helihu/4/edit?js,output

One of these commits includes a test to validate that the optimization produces the same result, it is then subsequently removed in a further commit. I leave this in the history in case a re-validation is required.

qrohlf commented 8 years ago

First of all, thanks for this. It sounds like you put a lot of work into it and I appreciate the performance improvements. Unfortunately, I think something went wrong with the PR and you've got over a year of commit history in the diff, which makes it really hard for me to review. Maybe try rebasing and force pushing to see if that fixes it?

enzuguri commented 8 years ago

Hi @qrohlf, yes I thought it was a bit off. In your contributing guide (contributing.md) you mention that PR should have the target branch of gh-pages, which probably explains the massive diff. I can edit this to point to master should you require?

qrohlf commented 8 years ago

Oops, that's an outdated doc from when the documentation and the library were the same codebase. You'll want to re-open the PR against master and then everything should be good.

+1 for reading the docs... sorry that they were wrong 😬

qrohlf commented 8 years ago

(I'll update the CONTRIBUTING file now)