qrohlf / trianglify

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

Is there a way to update settings on an object? #44

Closed TheInitializer closed 9 years ago

TheInitializer commented 9 years ago

I want to change the cell_size property dynamically and redraw the canvas but don't want to regenerate as that will create a completely different design... is that possible?

In the demos on your site you seem to have called a setState function but I don't seem to have that...

qrohlf commented 9 years ago

You may find the seed option useful - however, changing the cell size will result in a different number of points being added to the matrix and therefore a different design.

If what you want to achieve is a zoom functionality, you would be better served using some other technique rather than re-running the (computationally expensive) delauney triangulation algorithm for each redraw. The polygon coloring and geometry that trianglify uses to render is exposed in the pattern object that calls to Trianglify() return.

TheInitializer commented 9 years ago

Thanks, that's just what I needed. :)