qrohlf/trianglify

Feature Proposal: Web Worker support/example

qrohlf opened this issue · 0 comments

I'd like to run some tests on how to move Trianglify computations off the main thread.

The main use case here is increasing the responsiveness of the sliders on https://trianglify.io/ - normally, for high-framerate use cases I would recommend implementing custom animation logic on the raw geometry output of Trianglify, but because the input sliders require mesh re-generation and re-coloring this is a unique situation that means I have to call the full trianglify().toCanvas() pipeline every time the user moves a slider.

Throttling to 15fps and/or using requestAnimationFrame can help in some situations, but ultimately moving pattern computation off the UI thread would be the most effective solution to this problem.